本文介绍了JButton Hellp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 所以我想设置Jbutton的背景颜色。我知道做这种事情的正常方法是以下方式: JButton button = new JButton(" xxxx"); button .setBackground(Color.RED); 但在我的程序中我按以下方式添加我的Jbutton .. horizo​​ntalBox2 = Box.createHorizo​​ntalBox (); horizo​​ntalBox2.add(新JButton(黑色)); 所以如何设置此按钮的背景颜色说黑...任何帮助,将不胜感激。谢谢。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.setBackground(Color.RED); but in my program i add my Jbutton the following way.. horizontalBox2=Box.createHorizontalBox(); 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.推荐答案 展开 | 选择 | Wrap | 行号 展开 | 选择 | Wrap | 行号 展开 | 选择 | Wrap | 行号 这篇关于JButton Hellp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-28 13:48