Home » Newcomers » Newcomers » Default package's Cadence.java is now inoperable(All smoke and no fire, sorry. Probably it was due to my old nemesis, Operator Error.)
Default package's Cadence.java is now inoperable [message #1797242] |
Mon, 29 October 2018 05:56 |
Patrick Moran Messages: 141 Registered: March 2018 |
Senior Member |
|
|
This question is based on a mistake. Cadence.java is a file that I had copied to experiment with. How it got referred to when I was working on another project, I don't know.
import javax.swing.*;
import java.awt.*;
import java.awt.*;
import java.applet.Applet;
import java.applet.AudioClip;
import java.net.URL;
public class Cadence extends JFrame {
URL url = [u]AddSound[/u].class.getResourceAsStream([u]soundTest[/u].wav);
[u]AudioClip[/u] clip = [u]Applet.newAudioClip[/u](url);
public void AddSound() {
[u]super("AddingSound");[/u]
[u]setLayout (now[/u] FlowLayout());
[u]Play[/u].addActionListenerI( new [u]ActionListener[/u]){
public void
[u]clip.play[/u];
}
});
[u]Loop[/u].addActionListener(new [u]ActionListener[/u]() {
public void actionPerformed([u]ActopmEvemt evemt[/u]{]
[u]clip.play[/u]();
}
});// end of AddSound
[u]Stop.addActionListene[/u]r({
public void actionPerfoirmed([u]ActionEvent[/u] event) {
}
});
add([u]Play[/u]);
add([u]Loop[/u]);
add([u]Stop[/u]);
}
None of the colors or strike-throughs came through so I'll try to add a screen shot. I tried to fix this file but couldn't handle so many interacting problems.
Somebody must be in charge of writing and of the upkeep of this piece of code. It needs to be rewritten.
[Updated on: Sun, 11 November 2018 16:15] Report message to a moderator
|
|
| |
Re: Default package's Cadence.java is now inoperable [message #1797450 is a reply to message #1797333] |
Wed, 31 October 2018 06:48 |
Patrick Moran Messages: 141 Registered: March 2018 |
Senior Member |
|
|
Thank you for your reply, but please note that Cadence is a class located in the default package.
If I had the ability to program Java's own Java code at a developer's level, I might be able to fix this code for Java.
I had simply copied over a program I wrote and had been using for some time on Oxygen, where there was no problem, to a new computer and the new Photon. All of a sudden the thing would not work. There was no sign of any errors showing on my own code. By chance I learned how to go deeper down and find the problem in Cadence. Cadence is either something that Java wrote or possibly something the Eclipse wrote. Even if I managed to fix all of the dependencies that are now creating problem in the Cadence code, it would not do other Eclipse users any good, nor would it do other Java users any good.
I am on my old computer now, getting ready to decommission it, so I can't see what any hovering showed me the last time, but as you can see by the crossed out items (java.applet.Applet, and java.applet.AudioClip, ) it would appear that they are deprecated, and I would guess that they have gone beyond that point and have been removed entirely from the latest Java. As for the rest of default package/Cadence, about half of the lines have red underlining. None of this is, and none of it depends on, code that I have written.
I can just find another way to play MP3 files in my program, but somebody else will sooner or later find that their code is mysteriously failing and they may not luck out and discover that the problem is something in the default package.
Actually, as somebody else wrote in a critique of Eclipse elsewhere, it is better not to advance forward through new versions of Eclipse if the old version is working o.k. for you. Probably I will just delete Photon from my new computer and hope that putting Oxygen in its place will eliminate some of these problems.
Thanks again for your help.
|
|
| | | |
Re: Default package's Cadence.java is now inoperable [message #1797518 is a reply to message #1797494] |
Thu, 01 November 2018 05:54 |
Patrick Moran Messages: 141 Registered: March 2018 |
Senior Member |
|
|
I'm sorry. I really thought the problem was in some kind of a sub-structure provided by Eclipse. Trying to write about it from my old computer, because I was involved in preparing to scrub that hard drive and reinstall everything, didn't help my memory. I had to get both computers going to see what was going on with the new computer and write about it with the old computer.
I had forgotten how Eclipse will sometimes bring in stuff from one project to the operation of another project. I just an hour or so ago had one really messed up old project that, when you tried to run it, would instead run the previous project. I quit Eclipse, rebooted, and it still did that odd thing.
I think what happened was that I was trying to verify a normally well-working project, found a problem, and then somehow my searches brought me to a Java program that was right after the one I was really working on, i.e., to one that had Cadence.java as its only class. It was a program I had copied from the Internet and never could get working, I guess. But I had no memory of the program by name or by contents when its contents showed up while I was trying to discover why the one I was trying to verify was not getting data from a DB. It wasn't open in the package explorer, so the only open-to-inspection stuff was just part of the project I was starting to work on, and I guessed that if it wasn't in a visible java program it had to be in the enclosing sub-directory. Obviously, now that I've done some more snooping, it wasn't anywhere in that subdirectory at all.
I used to be more careful about frequently starting new work spaces to avoid this kind of cross-contamination, but I hadn't had any problems for a long time and had gotten sloppy about breaking things up so that they could not interfere. (I don't see why Eclipse wasn't designed to avoid this unannounced kind of drawing on material from one project to use in another project.)
Again, I am sorry for the confusion.
|
|
|
Goto Forum:
Current Time: Mon Sep 23 01:13:51 GMT 2024
Powered by FUDForum. Page generated in 0.11068 seconds
|