设置JFrame的背景色 [英] Setting background color for a JFrame

查看:149
本文介绍了设置JFrame的背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何设置JFrame的背景颜色?

Just how do you set the background color for a JFrame?

推荐答案

检索框架的内容窗格,并使用

Retrieve the content pane for the frame and use the setBackground() method inherited from Component to change the color.

示例:

myJFrame.getContentPane().setBackground( desiredColor );

这篇关于设置JFrame的背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆