Results 1 to 2 of 2
  1. #1
    osval is offline Member
    Join Date
    Jul 2007
    Rep Power

    Default resize tabs in jtabbedpane

    I have created tabs using jtabbedpane, and want to put only image icons.
    but this tab is not fitting into an image size
    Tab should be fitted as image size
    any ideas or suggestions??

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Rep Power


    I assume you are adding JLabels to the tabbedPane, each label with an ImageIcon.
    Call pack on the top–level container to "fit" the tabbedPane. It will have the size of the largest label/image. Or you can add the tabbedPane to a container whose layout respects the tabbedPanes preferredSize, such as a GridBagLayout.
    If an image is too big put the label in a JScrollPane.

Similar Threads

  1. Replies: 1
    Last Post: 02-17-2008, 12:43 AM
  2. Adding Tabs to JTabbedPane
    By blackstone in forum AWT / Swing
    Replies: 2
    Last Post: 11-14-2007, 04:15 PM
  3. Help with JTabbedPane
    By lenny in forum SWT / JFace
    Replies: 1
    Last Post: 08-07-2007, 07:18 AM
  4. Resize frame
    By lenny in forum AWT / Swing
    Replies: 1
    Last Post: 07-30-2007, 12:18 AM
  5. Help with JTextArea, resize windows
    By paul in forum AWT / Swing
    Replies: 1
    Last Post: 07-16-2007, 05:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts