So I want to set the background color of a Jbutton. I know that the normal way to do such a thing is down the following way:
JButton button = new JButton("xxxx") ;
button.setBackg round(Color.RED );
but in my program i add my Jbutton the following way..
horizontalBox2= Box.createHoriz ontalBox();
horizontalBox2. add(new JButton("Black" ));
so how would i go about setting the background color of this button to say black??? Any help would be appreciated. Thanks.
JButton button = new JButton("xxxx") ;
button.setBackg round(Color.RED );
but in my program i add my Jbutton the following way..
horizontalBox2= Box.createHoriz ontalBox();
horizontalBox2. add(new JButton("Black" ));
so how would i go about setting the background color of this button to say black??? Any help would be appreciated. Thanks.
Comment