java - Center JTable's cells to the middle of the JTable -


how center jtable cells middle of jtable?

i using table paint boxes in table, when resized, cells remain left-top aligned. when table fits cells nicely, not problem. when resize window (and table it), wrong:

fine lookingwrong

my question is, possible make cells appear in middle of table? suppose use glues on sides (this borderlayout), rather take approach.

since tablecellrenderer painting colored blocks, put table in flowlayout , override getpreferredscrollableviewportsize().

private static final int wide = 10; private static final int high = 20; private static final int size = 50; ... @override public dimension getpreferredscrollableviewportsize() {     return new dimension(wide * size, high * size); } 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -