java - How to change color of the window -


i making networking app in java, server connects several terminals together. wanted give server app darker feel (grays , blacks), cannot seem change background color default light gray.

here's picture of application can tell i'm doing:

picture of program

i tried using

this.getcontentpane().setbackground(new color(50, 50, 50)); 

however didn't change background color. tried changing jscrollpane's background , foreground color, didn't anything.

changing table's background makes background of cells darker, not rest of window. appreciated!

thanks

edit: here code far:

jtable serverlist;     jscrollpane scrollpane;     container container = this.getcontentpane();      public guimain()     {         this.setlayout(new borderlayout());          this.getcontentpane().setbackground(new color(50, 50, 50));         serverlist = new jtable(variables.servers, variables.serversheader);         serverlist.setrowselectionallowed(true);         scrollpane = new jscrollpane(serverlist);         serverlist.setfillsviewportheight(true);         add(scrollpane, borderlayout.north);     } 

the scrollpane takes whole window, light-gray background trying rid of scrollpane's viewport. here how change it:

scrollpane.getviewport().setbackground(new color(50, 50, 50)); serverlist.setfillsviewportheight(false); // ^-- jtable not fill viewport 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -