Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Making JTabbed Pane visible???  RSS feed

 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

the situation is like this..

I have a JFrame( main window) and in this i have a JMenu bar .Just beneath it i have a JToolbar and below it a JTabbed Pane.

Now on clicking JMenu Item say New JTabbed Pane should be visible.
I have added a event listener to New like this

private void NewClicked(ActionEvent e) {

System.out.println(e.getActionCommand());

if(e.getActionCommand().equalsIgnoreCase("New"))
{
MainTabbedPane.setVisible(true);
}
}


But this isnt working??? Should i add JToolbar to JPanel???

Plzz reply..
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works OK in this

 
Dave Robbins
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have to add a tab to it before it becomes visible
Michael's code shows how

Dave
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!