标题:象棋二(chessFrame.java)
取消只看楼主
编写蓝图
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2005-11-28
 问题点数:0 回复次数:0 
象棋二(chessFrame.java)

package chess;

import java.awt.Toolkit;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Dimension;

public class chessApp {
boolean packFrame = false;

/**
* Construct and show the application.
*/
public chessApp() {
chessFrame frame = new chessFrame();
// 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();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
}

/**
* Application entry point.
*
* @param args String[]
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(UIManager.
getSystemLookAndFeelClassName());
} catch (Exception exception) {
exception.printStackTrace();
}

new chessApp();
}
});
}
}

搜索更多相关主题的帖子: 象棋 java chessFrame import awt 
2006-04-11 12:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-56743-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.422174 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved