Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java GUI 设计 » Swing  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:下载了look and feel,不知道怎么用!!>_< [Re:djlzxzy]
sc33



版主


发贴: 128
积分: 30
于 2004-06-09 14:21 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
仅举例说明!

如:

import javax.swing.UIManager;
import java.awt.*;
import com.incors.plaf.alloy.AlloyLookAndFeel; //首先引用Look&Feel的类包

public class Football_MainApp {
boolean packFrame = false;

//Construct the application
public Football_MainApp() {
Football_MainFrame frame = new Football_MainFrame();
//Validate frames that have preset sizes
//Pack frames that have useful preferred size info, e.g. from their layout
if (packFrame) {
frame.pack();
}
else {
frame.validate();
}
//Center the window
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
frame.setSize(new Dimension(screenSize.width,screenSize.height));
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation(0,0);
frame.setVisible(true);
}
//Main method
public static void main(String[] args) {
try {
//设置Look&Feel的具体参数
AlloyLookAndFeel alloyLnF = new AlloyLookAndFeel();
alloyLnF.setProperty("alloy.isSandbox", "true");
alloyLnF.setProperty("alloy.isLookAndFeelFrameDecoration", "true");
UIManager.setLookAndFeel(alloyLnF);
UIManager.setLookAndFeel("com.incors.plaf.alloy.AlloyLookAndFeel");
}
catch(Exception e) {
e.printStackTrace();
}
new Football_MainApp();
}
}




话题树型展开
人气 标题 作者 字数 发贴时间
6483 下载了look and feel,不知道怎么用!!>_< djlzxzy 86 2004-06-08 14:18
4718 Re:下载了look and feel,不知道怎么用!!>_< floater 63 2004-06-08 22:07
6593 Re:下载了look and feel,不知道怎么用!!>_< sc33 1540 2004-06-09 14:21

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923