java - How to remove indents in the tabs JTabbedPane? -
java - How to remove indents in the tabs JTabbedPane? -
how remove indents around icon tabs in jtabbedpane
? i.e. icon on total size of tabs?
you can seek next trick gettabinsets()
method of basictabbedpaneui
:
import java.awt.insets; import javax.swing.imageicon; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jtabbedpane; import javax.swing.uimanager; import javax.swing.unsupportedlookandfeelexception; import javax.swing.plaf.basic.basictabbedpaneui; public class testframe extends jframe { public testframe() { setdefaultcloseoperation(jframe.exit_on_close); init(); pack(); setvisible(true); } private void init() { seek { uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); } grab (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { e.printstacktrace(); } jtabbedpane pane = new jtabbedpane(jtabbedpane.bottom); pane.addtab("", new imageicon(testframe.class.getresource("1111.png")), new jlabel("lbl")); pane.addtab("test2", new jlabel("lbl2")); pane.setfocusable(false); pane.setui(new basictabbedpaneui() { @override protected insets gettabinsets(int tabplacement, int tabindex) { homecoming new insets(0, 0, 0, 0); } }); add(pane); } public static void main(string... strings) { new testframe(); } }
also seek calculatetabwidth()
, calculatetabheight()
.
java swing user-interface jtabbedpane
Comments
Post a Comment