accarvajal
asked on
JTabbedPane on JInternalFrame
Hi!
I have some problems because I have a JInternalFrame into which I need to add a JTabbedPane with 2 tabs, so I did following:
JInternalFrame dialog = new JInternalFrame("My Dialog");
dialog.setLayout(null);
dialog.setVisible(true);
...
...
JTabbedPane tabs = new JTabbedPane();
JPanel pnl1 = new JPanel();
pnl1.setLayout(null);
pnl1.setVisible(true);
JTextField txt = new JTextField();
txt.setBounds( 10, 35, 150, 20 );
pnl1.add(txt);
JPanel pnl2 = new JPanel();
pnl2.setLayout(null);
pnl2.setVisible(true);
tabs.addTab("Tab1", null, pnl1);
tabs.addTab("Tab2", null, pnl1);
tabs.setVisible(true);
dialog.getContentPane().ad d(tabs);
Why JTabbedPane is not shown or at least I can't see it, not even tabs created,
thanks
I have some problems because I have a JInternalFrame into which I need to add a JTabbedPane with 2 tabs, so I did following:
JInternalFrame dialog = new JInternalFrame("My Dialog");
dialog.setLayout(null);
dialog.setVisible(true);
...
...
JTabbedPane tabs = new JTabbedPane();
JPanel pnl1 = new JPanel();
pnl1.setLayout(null);
pnl1.setVisible(true);
JTextField txt = new JTextField();
txt.setBounds( 10, 35, 150, 20 );
pnl1.add(txt);
JPanel pnl2 = new JPanel();
pnl2.setLayout(null);
pnl2.setVisible(true);
tabs.addTab("Tab1", null, pnl1);
tabs.addTab("Tab2", null, pnl1);
tabs.setVisible(true);
dialog.getContentPane().ad
Why JTabbedPane is not shown or at least I can't see it, not even tabs created,
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yes that will do it
ASKER
ok thanks, let me try and I will answer you about it
ASKER
YES! objects, that did it, points are you, thanks
ASKER