|
jordanwb@jordanwb-laptop:/media/DEFB-0C36/PhpDesigner$ java -jar PhpDesigner.jar
Exception in thread "main" java.lang.NoSuchMethodError: main
The main method does exist in the startup class.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class MainWindow extends JFrame implements ActionListener
{
private JMenuBar main_menu;
private JMenu file_menu;
private JMenuItem new_project, open_project, save_project, save_project_as, quit;
private JMenu objects_menu;
private JMenuItem add_folder, add_file, add_class, add_interface, add_function, add_parameter, add_field;
private JPanel php_object_manager;
public MainWindow()
{
super ("PhpDesigner");
this.setSize (800, 600);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.new_project = new JMenuItem("New Project", new ImageIcon ("./Images/document-new.png"));
this.new_project.addActionListener (this);
this.open_project = new JMenuItem("Open Project", new ImageIcon ("./Images/document-open.png"));
this.open_project.addActionListener (this);
this.save_project = new JMenuItem("Save Project", new ImageIcon ("./Images/document-save.png"));
this.save_project.addActionListener (this);
this.save_project_as = new JMenuItem("Save Project As", new ImageIcon ("./Images/document-save-as.png"));
this.save_project_as.addActionListener (this);
this.quit = new JMenuItem("Quit", new ImageIcon ("./Images/system-log-out.png"));
this.quit.addActionListener (this);
this.file_menu = new JMenu ("File");
this.file_menu.add (this.new_project);
this.file_menu.addSeparator();
this.file_menu.add (this.open_project);
this.file_menu.add (this.save_project);
this.file_menu.add (this.save_project_as);
this.file_menu.addSeparator();
this.file_menu.add (this.quit);
this.main_menu = new JMenuBar ();
this.main_menu.add (this.file_menu);
this.getContentPane().add (this.main_menu, BorderLayout.NORTH);
this.add_folder = new JMenuItem ("Add Folder");
this.add_file = new JMenuItem ("Add File");
this.add_class = new JMenuItem ("Add Class");
this.add_interface = new JMenuItem ("Add Interface");
this.add_function = new JMenuItem ("Add Function");
this.add_parameter = new JMenuItem ("Add Parameter");
this.add_field = new JMenuItem ("Add Field");
this.objects_menu = new JMenu ("Objects");
this.objects_menu.add (this.add_folder);
this.objects_menu.add (this.add_file);
this.objects_menu.add (this.add_class);
this.objects_menu.add (this.add_interface);
this.objects_menu.add (this.add_function);
this.objects_menu.add (this.add_parameter);
this.main_menu.add (this.objects_menu);
this.setVisible (true);
}
public void actionPerformed(ActionEvent e)
{
Object source = e.getSource ();
if (source == this.new_project) { }
else if (source == this.save_project) { }
else if (source == this.save_project_as) { }
else if (source == this.quit)
{
System.exit(0);
}
}
public static void main ()
{
new MainWindow ();
}
}
|
|
|
|
|
How did you create your 'jar'; did you use a correct manifest file to identify the class containing the main() method?
|
|
|
|
|
I used BlueJ to create the jar which I believe creates the manifest file for me.
|
|
|
|
|
Jordanwb wrote: I used BlueJ
I'm afraid I know nothing about BlueJ so you need to go to the documentation to check it out. Alternatively you could deconstruct the jar file and check the files yourself.
|
|
|
|
|
This is the content of the manifest file:
Main-Class:MainWindow
|
|
|
|
|
Sorry, that looks OK, I'm not sure what else to suggest.
|
|
|
|
|
I added String[] args to the args of main () and it works.
|
|
|
|
|
Interesting; I actually wondered about that yesterday, but did not bother to test it out.
To paraphrase Sherlock Holmes: "When you have eliminated the impossible, whatever remains, however improbable, must be the answer".
|
|
|
|
|
It sortof makes sense. Java apps are capable of processing arguments, altough they're infrequently used on Windows. Another thing I forgot was that the first letter of a method is always lowercase. I had to rename Main (String[]) to main (String[]).
|
|
|
|
|
Jordanwb wrote: It sortof makes sense.
As with most things in IT.
|
|
|
|
|
I had upgraded QuickBooks 2009 to 2010 edition for my dad. The conversion started off at taking four hours, then down t 2 and a half hours, down to twelve minutes then down to 3. The whole process took around 2 minutes.
|
|
|
|
|
Umm, I think maybe this belongs to an alternative thread.
|
|
|
|
|
Hello Friends
I m using MouseZoom in my application and it is zoooming fine but when I zoom Out with mouse wheel then after zooming up to a certain point the image becomes invisible and then I have to again zoomin then it comes in.I dont want to make that image invisible when i do zoom out.
Do u have any Ideas?
Thanks & Regards
Yogesh
|
|
|
|
|
please mail the java coding for Packet Scheduler with Packetized Ordered Round Robin Scheduling
|
|
|
|
|
thileebandr wrote: please mail the java coding ...
That's not the way it works here. Show us what you have tried and what is not working, and people will try and help. If you want someone to do your work for you then try the Jobs forum.
|
|
|
|
|
hello Friends
I m reading a file using tokenizer and in that i am reading some bitmap paths but I dont know after reading all the paths it starts again and gives me this exception:
java.net.MalformedURLException: unknown protocol: e
eVEN i M using the condition of tokenizer.TT_EOF
Please suggest me y this exception is coming?
Thanks
Yogesh
|
|
|
|
|
Hint: MalformedURLException
It looks as though the URL you are using contains some invalid formatting or characters. Take a look at the content and see what is wrong with it.
|
|
|
|
|
thx for ur reply.
I want to know how can we read a .tga extension image file using imageIO.read.
I am reading .jpeg file but it is not reading .tga file.
I am doing like this:
String imageFilename = "c:\\sample.jpg";
imageIO.read(new File(imageFilename));
Any Ideas for rading .tga file?
Thanks in Advance
Yogesh
|
|
|
|
|
yogeshs wrote: Any Ideas for rading .tga file?
Sorry no; did you try Google?
|
|
|
|
|
ok,no prob.I tried google first.
But if u get then plz tell me.
thx anyway.
|
|
|
|
|
Yes, I looked at Google also and it seems TGA is not supported in native Java. However there were a few links which may offer the answer; I searched on ImageIO TGA Java.
|
|
|
|
|
|
Sorry, but I don't know anything about TGA, you will have to work it out for yourself using whatever documentation and other tools are available. It's a pity that you are forced to use a file format that does not have widespread support!
|
|
|
|
|
Richard MacCutchan wrote: a file format that does not have widespread support
TGA files are very widely supported within certain applications, e.g. games, CGI, ray-tracing, things like that. The fact that Java does not support it natively does not mean that it does not have widespread support.
|
|
|
|
|
David Skelly wrote: The fact that Java does not support it natively does not mean that it does not have widespread support.
My comment was strictly within the context of this Q&A and was nothing to do with the world outside.
|
|
|
|