Link to home
Start Free TrialLog in
Avatar of accarvajal
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().add(tabs);

Why JTabbedPane is not shown or at least I can't see it, not even tabs created,

thanks
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of accarvajal
accarvajal

ASKER

How, using setBounds?
yes that will do it
ok thanks, let me try and I will answer you about it
YES! objects, that did it, points are you, thanks