Forums Login/signup

can not find methods

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Thanks a lot for that, fixed all my errors

reply
reply
This thread has been viewed 6998 times.
Similar Threads
Applet Login via database
cant find method from JOptionPane class
[SOLVED] must implement the inherited abstract method
NullPointerException occured
FlowLayout manager wont work
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 30, 2025 23:39:18.