![]() |
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() { } } |
1) use code tags
2) could you post the errors you are getting? |
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 |
Quote:
Here try this. |
| All times are GMT -5. The time now is 12:45 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC