Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can not find methods

 
Ben Hultin
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now I am sure this is a tiny problem, but I cant figure it out.

here are the errors I am getting:



GUI_Event_Handler.java:11: cannot find symbol
symbol : method setDefaultCloseOperation(int)
location: class GUI_Event_Handler_Sub
guiEvent.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
^
GUI_Event_Handler.java:12: cannot find symbol
symbol : method setSize(int,int)
location: class GUI_Event_Handler_Sub
guiEvent.setSize(350, 100);
^
GUI_Event_Handler.java:13: cannot find symbol
symbol : method setVisible(boolean)
location: class GUI_Event_Handler_Sub
guiEvent.setVisible(true);
^
.\GUI_Event_Handler_Sub.java:18: Object() in java.lang.Object cannot be applied
to (java.lang.String)
super("the title");
^
.\GUI_Event_Handler_Sub.java:21: cannot find symbol
symbol : method setLayout(java.awt.FlowLayout)
location: class GUI_Event_Handler_Sub
setLayout(new FlowLayout());
^
.\GUI_Event_Handler_Sub.java:25: cannot find symbol
symbol : method add(javax.swing.JTextField)
location: class GUI_Event_Handler_Sub
add(item1);
^
.\GUI_Event_Handler_Sub.java:29: cannot find symbol
symbol : method add(javax.swing.JTextField)
location: class GUI_Event_Handler_Sub
add(item2);
^
.\GUI_Event_Handler_Sub.java:35: cannot find symbol
symbol : method add(javax.swing.JTextField)
location: class GUI_Event_Handler_Sub
add(item3);
^
.\GUI_Event_Handler_Sub.java:39: cannot find symbol
symbol : method add(javax.swing.JPasswordField)
location: class GUI_Event_Handler_Sub
add(passwordField);
^
.\GUI_Event_Handler_Sub.java:73: cannot find symbol
symbol : variable JOptionpane
location: class GUI_Event_Handler_Sub.thehandler
JOptionpane.showMessageDialog(null, string);
^
10 errors




Here is my driver class:




here is my driven class:




Thanks a lot for the help
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure your GUI_Event_Handler_Sub class is not supposed to extend any other class? The compile complains because your GUI_Event_Handler_Sub class uses methods like setLayout() or add() for which, it cannot find any definitions.
 
Maneesh Godbole
Saloon Keeper
Posts: 10974
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pushkar is correct.
Check out the API to see which class these methods belong to. (You can use the "index" and "search" in your api docs to find this out)
After that, you will have two options
1) Make your class extend the original class you find
2) Provide your own implementation for these methods.

I personally would choose #1
 
Ben Hultin
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for that, fixed all my errors
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic