I've been playing with this for some time and I haven't been able to get my applet to center in the middle of a tabbed pane in my jframe:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| JFrame.setDefaultLookAndFeelDecorated(false); setSize(500,500); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBackground(Color.gray); JTabbedPane tabbedPane = new JTabbedPane(); JPanel appletpanel = new JPanel(new BorderLayout(),false); applet=new jsgcApplet(); appletpanel.add(applet,BorderLayout.CENTER); editor=new JEditorPane(); JScrollPane editorpane = new JScrollPane(editor); tabbedPane.add("Display",appletpanel); tabbedPane.add("Script Editor",editorpane); getContentPane().add(tabbedPane,BorderLayout.CENTER); applet.init(); applet.start(); setVisible(true); |
Does anyone see anything blatantly wrong with my code?
Edit: With this code it is set at the top right corner