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

    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
    Posts
    1,576
    Rep Power
    9

    Default

    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-16-2008, 11:43 PM
  2. Adding Tabs to JTabbedPane
    By blackstone in forum AWT / Swing
    Replies: 2
    Last Post: 11-14-2007, 03:15 PM
  3. Help with JTabbedPane
    By lenny in forum SWT / JFace
    Replies: 1
    Last Post: 08-07-2007, 06:18 AM
  4. Resize frame
    By lenny in forum AWT / Swing
    Replies: 1
    Last Post: 07-29-2007, 11:18 PM
  5. Help with JTextArea, resize windows
    By paul in forum AWT / Swing
    Replies: 1
    Last Post: 07-16-2007, 04: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
  •