user3140788
user3140788

Reputation: 1

Dynamic creation of JTabbedPane

I'm beginner with Netbeans and GUI. I want to create JTabbedPane by click on one button and wants also that tabbed pane name will be the name of the button: I used this code but nothing appears!

JTabbedPane jtp1=new JTabbedPane();
jtp1.setVisible(true);
jtp1.addTab(jButton1.getName(), jPanel6);

I want also to add this tabbed pane to a panel and it will be the same size of the panel.

Upvotes: 0

Views: 129

Answers (1)

Paul Becotte
Paul Becotte

Reputation: 9977

I highly recommend working through this tutorial from Oracle before you spend a lot of time figuring out how to make it work in netbeans. At some point you will have to understand what netbeans is doing to the code and why... it is a lot easier to get that info first and then use the IDE to help shortcut it then to try and figure out where in the mess of code the IDE generated you should start learning.

http://docs.oracle.com/javase/tutorial/uiswing/

Upvotes: 1

Related Questions