- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
如何设置java桌面程序界面外观(how to set the look and feel)(如何设置java桌面程序界面外观(如何设置的外观和感觉))
如何设置java桌面程序界面外观(how to set the look and feel)(如何设置java桌面程序界面外观(如何设置的外观和感觉))
How do I set the Java desktop to Feel (How Set the Look and)?
Content directory:
1. use UIManager.setLookAndFeel to specify the appearance of the interface by programming
How does the 2. UI Manager select the appearance of the interface?
3. after starting, change the appearance of the interface
1. use UIManager.setLookAndFeel to specify the appearance of the interface by programming
The sample code is as follows: [1]
[java], view, plaincopyprint?
Import javax.swing.*;
Import java.awt.*;
Public, class, Hello, extends, JFrame {
Public, Hello () {
SetPreferredSize (New Dimension (600, 400));
Pack ();
SetDefaultCloseOperation (EXIT_ON_CLOSE);
SetVisible (true);
}
Public, static, void, main (String[], args) {
{try
String lookAndFeel =
UIManager.getCrossPlatformLookAndFeelClassName ();
UIManager.setLookAndFeel (lookAndFeel);
Catch (Exception E) {}}
New, Hello ();
}
}
Import javax.swing.*;
Import java.awt.*;
Public, class, Hello, extends, JFrame {
Public, Hello () {
SetPreferredSize (New Dimension (600, 400));
Pack ();
SetDefaultCloseOperation (EXIT_ON_CLOSE);
SetVisible (true);
}
Public, static, void, main (String[], args) {
{try
String lookAndFeel =
UIManager.getCrossPlatformLookAndFeelClassName ();
UIManager.setLookAndFeel (lookAndFeel);
Catch (Exception E) {}}
New, Hello ();
}
Parameter} approach in setLookAndFeel is the full name of the class LookAndFeel (fully qualified name). To set up Java (Java Look and Feel interface), we use the getCrossPlatformLookAndFeelClassName method. If you want to set for the program to run the platform interface appearance, you can use the getSystemLookAndFeelClassName method. To set up a special UI, you you can use the specific name. For example, you want to set the Windows interface, you can use the following code:
[java], view, plaincopyprint?
UIManager.setLookAndFeel (
Com.sun.java.swing.plaf.windows.WindowsLookAndFeel);
UIManager.setLookAndFeel (
Com.sun.ja
您可能关注的文档
- 女生身体调节(Female body adjustment).doc
- 女生体寒的食疗方法(Diet therapy method for female students with body cold).doc
- 女性生理期的养生保健知识(Knowledge of health care in women's physiological phase).doc
- 女装冬装纯棉的洗涤方法(Ladies winter cotton washing method).doc
- 女性生理周期28天注意事项(Notes on female physiological cycle for 28 days).doc
- 女装网店名字大全(Women's clothing store name Daquan).doc
- 女贞子酒详解女贞子酒的功效与作用(Ligustrum lucidum wine detail the efficacy and role of Ligustrum lucidum wine).doc
- 女销售员拒酒妙方(The salesman refused wine recipe).doc
- 奶厅管理(Dairy management).doc
- 奶粉生产工艺流程(Milk powder production process).doc
- 如何训练好嗓音(How to train your voice well).doc
- 如何设置win7各种睡眠方式(How do I set win7 sleep modes).doc
- 如何设置议论文的分论点(精华篇)(How to set up the argumentation points of argumentation).doc
- 如何设计玄关(How to design entrance).doc
- 如何识别和争取您需要的人才(How to identify and strive for talents you need).doc
- 如何说谎(How to lie).doc
- 如何给神像开光(How to open the statue).doc
- 如何读历史(How to read history).doc
- 如何调理脾胃(How to recuperate the spleen and stomach).doc
- 如何解酒如何防止喝醉(How to relieve alcohol How to prevent getting drunk).doc
文档评论(0)