• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How To increase JToolBar, make JTabbedPanes scrollable

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the JToolBar that runs across the JFrame i have added with borderlayout to the north of the frame..after having buttons over it from the left tp the right end of the frame...now no further buttons added are being displayed on the JToolBAr.
i want if they are not coming in one line then they must come on the next line..which is not happening
my question is how to make the size of the JToolBar increase so that the icons in it come on the next line as we usually observe for instance in Microsoft Word...plz help me out to solve my problem..
my other problem is how to m ake the JTabbed Panes scrollable the Layout option that is SCROLL_TABLAYOUT is not working...
plz tell me where i am wrong...
i am here giving u my code for u..
public static final int SCROLL_TAB_LAYOUT = 1;
jtp = new JTabbedPane(JTabbedPane.TOP);
jtp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
plz solve my problem...
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as the JToolBar goes...What you are seeing in MS Word is actually 2 Toolbars. So that's what would be the easiest to do is create a second JToolBar.
Now, about the Scrolling JTabbedPane, here is how I do it
JTabbedPane tab = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
You don't need to set the INT value of SCROLL_TAB_LAYOUT.
Hope that helps a little.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic