![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2006
Posts: 3
Rep Power: 0
![]() |
error in my internalframe, why?
As far as i know this should display a internalframe when the menuitem doc is clicked but it comes up with a whole list of errors. when i correct them and run it they appear again could someone please tell me why and help me correct it! thanks
import javax.swing.JFrame; import javax.swing.UIManager; import javax.swing.JDesktopPane; import javax.swing.JMenuBar; import javax.swing.JMenu; import javax.swing.JMenuItem; import java.awt.event.ActionEvent; public class frame { private static String doc; public static void main(String[] args) { //create the frame JFrame frame = new JFrame("FrameDemo"); UIManager.LookAndFeelInfo.setPreferredLookAbdFeel(frame.class); frame.setVisible(true); //set up esktoppane JDesktopPane desk = new JDesktopPane(); //construct the menubar and to items JMenuBar mb = new JMenuBar(); JMenu file = new JMenu("File"); JMenuItem New = new JMenuItem("New"); //Optional: What happens when the frame closes? frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create components and put them in the frame. frame.add(mb); frame.add(file); frame.add(New); New.addActionListener(frame); frame.setJMenuBar(mb); // Size the frame. frame.pack(); //6. Show it. frame.setVisible(true); } public void actionperformed(ActionEvent e) { if ("new".equals(e)) { GetActtionComand(); } show(fr); { } // make a internal protected void createFrame() { //illegal start of exspresion InternalFrame fr = new JInternalFrame("doc"); JDesktopPane d = new JDesktopPane(); fr.setVisable(true); fr.setSelected(true); //quit operation Quit(0); System.exit(0); }; } /** * GetActtionComand */ private void GetActtionComand() { } } |
|
|
|
|
|
#2 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 762
Rep Power: 3
![]() |
1) use code tags
2) could you post the errors you are getting? |
|
|
|
|
|
#3 |
|
Sexy Programmer
|
Why did you make a new thread? You could have just posted the problem in your older thread. I bet you don't even have a clue on what you wanna do. By looking at your un-tagged code, you have very bad programming skills in Java and have a lot of errors.
Your code contains a lot of typos and unheard of methods. Google to search for what you want, b/c it makes me angry just looking at your code. Peace
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|