java - Remove space/border/margin of JTabbedPane -
image jtabbedpane http://img850.imageshack.us/img850/7339/immaginedya.png
how can remove selected margin of jtabbedpane
? :(
since nimbus l&f based on synth l&f guess have load custom synth style tabbed pane tab area custom insets specified (in case smaller left/right insets).
you can read styling synth here: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/synth.html
i guess style file (you can name whatever - e.g. style.xml) should this:
<synth> <style id="tabareastyle"> <insets top="0" left="0" right="0" bottom="0" /> </style> <bind style="tabareastyle" type="region" key="tabbedpanetabarea" /> </synth>
i found key tabbedpanetabarea looking synthtabbedpaneui
source code.
loading style:
final nimbuslookandfeel lookandfeel = new nimbuslookandfeel (); lookandfeel.load ( myclass.class.getresource ( "style.xml" ) );
then can use l&f:
uimanager.setlookandfeel ( lookandfeel );
edit1: checked - way works synthlookandfeel, nimbuslookandfeel seems final , cannot re-styled anyhow. nimbus painters have hardcoded values (including tab area insets want change).
edit2: in non-synth l&fs tab area insets taken uidefaults using tabbedpane.tabareainsets key. might useful if change l&f in end...
to summ up:
- as can see nimbus source code - cannot change margin in tabbed pane
- this margin can changed if use non-synth l&f
- this margin can changed if use synthlookandfeel itself
Comments
Post a Comment