Results 1 to 3 of 3

Thread: JTab Panes

  1. #1
    Nidi is offline Member
    Join Date
    Feb 2011
    Posts
    4
    Rep Power
    0

    Default JTab Panes

    Hi...

    Can anyone tell me how to increase the size of tabs in JTabbedPane();

    I used the following code...

    JTabbedPane tab = new JTabbedPane();
    tab.setSize(new Dimension(50,50));
    Component temporaryLostComponent=null;
    tab.add(temporaryLostComponent, "tab1");


    tab.add(temporaryLostComponent, "tab2");

    tab.add(temporaryLostComponent, "tab3");
    jp1.setVisible(true);

    ******************************************

    i found no difference after setting the size:(
    do i need to add anything extra????:confused:


    Thanks

  2. #2
    mr_guy is offline Member
    Join Date
    Feb 2011
    Posts
    18
    Rep Power
    0

    Default

    I found this way of setting tab width using html but i have no idea if it works:
    Java Code:
    tabbedPane.addTab("<html><body leftmargin=15 topmargin=8 marginwidth=15 marginheight=5>Tab1</body></html>",
                                            new JLabel("Text Component 1"));
    taken from:
    Change the tab size of JTabbedPane

    Edit: I just tried it and it does work
    Last edited by mr_guy; 03-01-2011 at 04:13 AM.

  3. #3
    Nidi is offline Member
    Join Date
    Feb 2011
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Replies: 9
    Last Post: 05-13-2010, 05:29 AM
  2. multiple panes problem
    By grease_monkey1986 in forum AWT / Swing
    Replies: 1
    Last Post: 05-09-2010, 01:06 PM
  3. Layered Panes
    By teckno101 in forum AWT / Swing
    Replies: 1
    Last Post: 10-03-2009, 11:16 PM
  4. panes, frames and ddm's :|
    By skatefreak in forum New To Java
    Replies: 1
    Last Post: 08-09-2009, 10:21 AM
  5. Two content panes in one GUI?
    By Leprechaun in forum New To Java
    Replies: 1
    Last Post: 01-31-2008, 04:02 AM

Posting Permissions

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