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:

  1. as can see nimbus source code - cannot change margin in tabbed pane
  2. this margin can changed if use non-synth l&f
  3. this margin can changed if use synthlookandfeel itself

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -