?
Solved

JTabbedPane on JInternalFrame

Posted on 2005-05-05
5
Medium Priority
?
898 Views
Last Modified: 2008-02-26
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
0
Comment
Question by:accarvajal
  • 3
  • 2
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 120 total points
ID: 13940635
You need to set your tabbed panes size (as you use no layout manager), or use a layout manager eg. BorderLayout.
0
 

Author Comment

by:accarvajal
ID: 13940642
How, using setBounds?
0
 
LVL 92

Expert Comment

by:objects
ID: 13940668
yes that will do it
0
 

Author Comment

by:accarvajal
ID: 13940674
ok thanks, let me try and I will answer you about it
0
 

Author Comment

by:accarvajal
ID: 13945246
YES! objects, that did it, points are you, thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question