java - Buttons Don't Initially Draw -



java - Buttons Don't Initially Draw -

i'm having issue applet buttons not draw until mouse on them. remain after that, 1 time click one, go away again. here code:

checkpanel = new jpanel(); buttonpanel = new jpanel(); buttonpanel.setlayout( new gridlayout( 1, 7 ) ); openadvancedsettings = new jbutton( "advanced settings" ); openadvancedsettings.addactionlistener( ); checkpanel = new jpanel(); checkvolt = new checkbox( "voltage", true ); checkv = new checkbox( "v gate", false ); checkw = new checkbox( "w gate", false ); checks = new checkbox( "s gate", false ); checkvolt.additemlistener( ); checkv.additemlistener( ); checkw.additemlistener( ); checks.additemlistener( ); checkpanel.setlayout( new gridlayout( 20, 8 ) ); checkpanel.add( butp ); checkpanel.add( prompt0 ); checkpanel.add( checkvolt ); checkpanel.add( prompt1 ); butt = new jbutton( "start" ); butt.addactionlistener( ); buttonpanel.add( butt ); setlayout( new borderlayout() ); add( checkpanel, borderlayout.east ); add( buttonpanel, borderlayout.north ); add( openadvancedsettings, borderlayout.south );

the first 2 adds jpanels, , lastly 1 jbutton. of buttons (all lastly one) in 2 panels.

i have come conclusion method repaint() causing happen. doing wrong?

i assuming in absence of sscce, must have failed set code, responsible creating , displaying gui, attaining concurrency in swing, within swingutilities.invokelater(...); secondly, can seek calling revalidate() method, on panel, before calling repaint(). might can solve problem time being.

hope might help in way. regards

java swing applet awt

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -