Java源码示例:org.jdesktop.swingx.JXPanel
示例1
public WeaponDataSaveService(
Collection<WeaponPojo> weapons,
String targetDatabase, String targetNamespace, String targetCollection) {
this.weapons = weapons;
this.targetDatabase = targetDatabase;
this.targetNamespace = targetNamespace;
this.targetCollection = targetCollection;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例2
public ShopDataPriceFromDBSaveService(ShopDataPriceResultModel model) {
this.model = model;
this.count = model.getRowCount();
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
simpleTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SIMPLE, 30);
normalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_NORMAL, 100);
solidTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SOLID, 200);
eternalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_ETERNAL, Integer.MAX_VALUE);
}
示例3
public EquipmentExportService(MyTableModel model, ShopDataPriceConfig config) {
this.model = model;
this.config = config;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例4
public EquipmentImportService(MyTableModel model, ShopDataPriceConfig config) {
this.model = model;
this.config = config;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例5
public CraftStonePrintService(CraftStoneResultModel model,
CraftStonePrintConfig config, int count, MyTablePanel tablePanel) {
this.model = model;
this.config = config;
this.count = count;
this.tablePanel = tablePanel;
this.model.setTotalCount(count);
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例6
public StrengthTestService(
StrengthTestConfig config, MyTablePanel tablePanel) {
this.model = model;
this.config = config;
this.count = config.getMaxTry();
this.tablePanel = tablePanel;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
model = new StrengthTestResultModel();
tablePanel.setTableModel(model);
}
示例7
public WeaponManualDataImportService(
File file,
WeaponTableModel model,
ArrayList<Double> dprList) {
this.importExcelFile = file;
this.weaponModel = model;
this.levelDprList = dprList;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例8
public ShopDataPricePrintService(MyTableModel model, ShopDataPriceConfig config) {
this.model = model;
this.config = config;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例9
public ShopDataPriceSaveService(ShopDataPriceResultModel model) {
this.model = model;
this.count = model.getRowCount();
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
simpleTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SIMPLE, 30);
normalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_NORMAL, 100);
solidTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SOLID, 200);
eternalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_ETERNAL, Integer.MAX_VALUE);
}
示例10
public void init() {
this.setSize(600, 400);
Point c = WindowUtils.getPointForCentering(this);
this.setLocation(c);
this.setLayout(new MigLayout("wrap 3"));
for ( PropDataSlotPanel panel : panels ) {
this.add(panel, "");
}
this.okButton.setActionCommand(ActionName.OK.name());
this.okButton.addActionListener(this);
this.cancelButton.setActionCommand(ActionName.CANCEL.name());
this.cancelButton.addActionListener(this);
JXPanel btnPanel = new JXPanel();
btnPanel.add(okButton);
btnPanel.add(cancelButton);
this.add(btnPanel, "dock south, width 100%");
this.pack();
this.setModal(true);
}
示例11
public void init() {
this.setTitle("消息管理");
this.setSize(500, 300);
Point p = WindowUtils.getPointForCentering(this);
this.setLocation(p);
this.setModal(true);
this.okButton.setActionCommand(ActionName.OK.name());
this.okButton.addActionListener(this);
this.cancelButton.setActionCommand(ActionName.CANCEL.name());
this.cancelButton.addActionListener(this);
this.infoField.setText("");
JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]"));
loginPanel.add(this.statusLabel, "span");
loginPanel.add(this.infoField, "span, growx");
loginPanel.setBorder(BorderFactory.createTitledBorder("PUSH"));
JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]"));
this.setLayout(new MigLayout("wrap 1"));
panel.add(loginPanel, "growx");
panel.add(this.okButton, "gaptop 5px, span, split 3, align center");
panel.add(this.cancelButton);
this.add(panel, "width 100%, height 100%");
}
示例12
public RedisCleanService(Jedis jedis) {
this.treeTableModel = treeTableModel;
this.jedis = jedis;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例13
public RedisRefreshService(RedisTreeTableModel treeTableModel, String host, int port) {
this.treeTableModel = treeTableModel;
this.host = host;
this.port = port;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例14
public RestoreMongoConfigService(File backupDir, boolean clean, String[] backupCollections) {
this.backupDir = backupDir;
this.backupDir.getParentFile().mkdirs();
this.cleanOldData = clean;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.backupCollections = backupCollections;
}
示例15
public BackupMongoConfigService(File backupDir, String[] backupCollections) {
this.backupDir = backupDir;
this.backupDir.getParentFile().mkdirs();
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.backupCollections = backupCollections;
}
示例16
public CopyMongoCollectionService(
String sourceDatabase, String sourceNamespace, String sourceCollection,
String targetDatabase, String targetNamespace, String targetCollection) {
this.sourceDatabase = sourceDatabase;
this.sourceNamespace = sourceNamespace;
this.sourceCollection = sourceCollection;
this.targetDatabase = targetDatabase;
this.targetNamespace = targetNamespace;
this.targetCollection = targetCollection;
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例17
@Override
public void installUI( JComponent c ) {
// must get UI defaults here because installDefaults() is invoked after
// installComponents(), which uses these values to create popup button
padding = UIManager.getInsets( "ComboBox.padding" );
arrowType = UIManager.getString( "Component.arrowType" );
borderColor = UIManager.getColor( "Component.borderColor" );
disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" );
disabledBackground = UIManager.getColor( "ComboBox.disabledBackground" );
buttonBackground = UIManager.getColor( "ComboBox.buttonBackground" );
buttonArrowColor = UIManager.getColor( "ComboBox.buttonArrowColor" );
buttonDisabledArrowColor = UIManager.getColor( "ComboBox.buttonDisabledArrowColor" );
buttonHoverArrowColor = UIManager.getColor( "ComboBox.buttonHoverArrowColor" );
super.installUI( c );
LookAndFeel.installProperty( datePicker, "opaque", false );
// hack JXDatePicker.TodayPanel colors
// (there is no need to uninstall these changes because only UIResources are used,
// which are automatically replaced when switching LaF)
JPanel linkPanel = datePicker.getLinkPanel();
if( linkPanel instanceof JXPanel && linkPanel.getClass().getName().equals( "org.jdesktop.swingx.JXDatePicker$TodayPanel" ) ) {
((JXPanel)linkPanel).setBackgroundPainter( null );
linkPanel.setBackground( UIManager.getColor( "JXMonthView.background" ) );
if( linkPanel.getComponentCount() >= 1 && linkPanel.getComponent( 0 ) instanceof JXHyperlink ) {
JXHyperlink todayLink = (JXHyperlink) linkPanel.getComponent( 0 );
todayLink.setUnclickedColor( UIManager.getColor( "Hyperlink.linkColor" ) );
todayLink.setClickedColor( UIManager.getColor( "Hyperlink.visitedColor" ) );
}
}
}
示例18
/**
* Fades in the specified message component in the top layer of this
* layered pane.
* @param message the component to be displayed in the message layer
* @param finalAlpha the alpha value of the component when fade in is complete
*/
public void showMessageLayer(JComponent message, final float finalAlpha) {
messageLayer = new JPanel();
messageLayer.setOpaque(false);
GridBagLayout gridbag = new GridBagLayout();
messageLayer.setLayout(gridbag);
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.CENTER;
messageAlpha = new JXPanel();
messageAlpha.setOpaque(false);
messageAlpha.setAlpha(0.0f);
gridbag.addLayoutComponent(messageAlpha, c);
messageLayer.add(messageAlpha);
messageAlpha.add(message);
add(messageLayer, JLayeredPane.POPUP_LAYER);
revalidate();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Animator animator = new Animator(2000,
new PropertySetter(messageAlpha, "alpha", 0.0f, finalAlpha));
animator.setStartDelay(200);
animator.setAcceleration(.2f);
animator.setDeceleration(.5f);
animator.start();
}
});
}
示例19
/**
* Fades in the specified message component in the top layer of this
* layered pane.
* @param message the component to be displayed in the message layer
* @param finalAlpha the alpha value of the component when fade in is complete
*/
public void showMessageLayer(JComponent message, final float finalAlpha) {
messageLayer = new JPanel();
messageLayer.setOpaque(false);
GridBagLayout gridbag = new GridBagLayout();
messageLayer.setLayout(gridbag);
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.CENTER;
messageAlpha = new JXPanel();
messageAlpha.setOpaque(false);
messageAlpha.setAlpha(0.0f);
gridbag.addLayoutComponent(messageAlpha, c);
messageLayer.add(messageAlpha);
messageAlpha.add(message);
add(messageLayer, JLayeredPane.POPUP_LAYER);
revalidate();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Animator animator = new Animator(2000,
new PropertySetter(messageAlpha, "alpha", 0.0f, finalAlpha));
animator.setStartDelay(200);
animator.setAcceleration(.2f);
animator.setDeceleration(.5f);
animator.start();
}
});
}
示例20
private JXPanel getNewsPanel() {
if (newsPanel == null) {
newsPanel = new QuickStartBackgroundPanel();
if (newsItem != null) {
this.showNews(newsItem);
}
}
return newsPanel;
}
示例21
public void init() {
this.setSize(650, 600);
Point point = WindowUtils.getPointForCentering(this.getOwner());
this.setLocation(point);
this.setResizable(true);
this.subjectField.setColumns(100);
this.contentField.setColumns(100);
this.contentField.setRows(20);
this.checkButton.setActionCommand(COMMAND_CHECK);
this.checkButton.addActionListener(this);
this.okButton.setActionCommand(COMMAND_OK);
this.okButton.addActionListener(this);
this.cancelButton.setActionCommand(COMMAND_CANCEL);
this.cancelButton.addActionListener(this);
this.panel.getInputMap().put(KeyStroke.getKeyStroke("ESCAPE"), "escape");
this.panel.getActionMap().put("escape", new EscapeAction());
//layout
panel.setLayout(new MigLayout("wrap 2, width 100%, gap 10px", "[25%][25%][25%][25%]"));
panel.setBorder(BorderFactory.createEtchedBorder());
panel.add(rolenameLabel, "");
panel.add(rolenameField, "span, growx");
panel.add(subjectLabel, "");
panel.add(subjectField, "span, growx");
panel.add(contentLabel, "");
panel.add(contentField, "span, growx");
panel.add(checkButton);
panel.add(okButton, "newline, gaptop 40px, span, split 2, align center");
panel.add(cancelButton);
JXPanel contentPanel = new JXPanel();
contentPanel.setLayout(new MigLayout("wrap 2, width 100%, height 100%"));
contentPanel.add(panel, "width 60%, height 100%, grow");
getContentPane().add(contentPanel);
}
示例22
public WeaponDataGeneratorService(List<String> namePrefixes, List<Integer> dprList, double[] params) {
this.origWeaponList = new ArrayList<WeaponPojo>();
List<DBObject> list = MongoUtil.queryAllFromMongo(null, database, namespace, "equipments", null);
for ( DBObject obj : list ) {
WeaponPojo weapon = (WeaponPojo)MongoUtil.constructObject(obj);
this.origWeaponList.add(weapon);
}
Collections.sort(this.origWeaponList);
if ( namePrefixes != null ) {
this.namePrefixes.addAll(namePrefixes);
}
if ( dprList != null ) {
this.dprList.addAll(dprList);
}
attackUnit = params[0];
defendUnit = params[1];
luckUnit = params[2];
agilityUnit = params[3];
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog = new JDialog();
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.progressBar.setIndeterminate(true);
}
示例23
@Override
protected void process(List<Integer> chunks) {
if ( stage == Stage.INIT ) {
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
dialog.add(panel);
dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
dialog.setLocation(p);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
label.setFont(MainFrame.BIG_FONT);
progressBar.setMaximum(count);
progressBar.setStringPainted(true);
dialog.setVisible(true);
} else if ( stage == Stage.DO_BALANCE_TEST ) {
label.setText("正在模拟战斗...");
if ( chunks != null && chunks.size()>0 ) {
int percent = chunks.get(chunks.size()-1);
progressBar.setValue(percent);
}
}
}
示例24
public ShopDataImportItemPriceService() {
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.progressBar.setIndeterminate(true);
}
示例25
public void init() {
this.setTitle("管理账户状态");
this.setSize(320, 430);
Point p = WindowUtils.getPointForCentering(this);
this.setLocation(p);
this.setModal(true);
this.statusField.setActionCommand(CMD_STATUS_SELECT);
this.statusField.addActionListener(this);
this.statusField.setSelectedIndex(0);
this.okButton.setActionCommand(ActionName.OK.name());
this.okButton.addActionListener(this);
this.cancelButton.setActionCommand(ActionName.CANCEL.name());
this.cancelButton.addActionListener(this);
this.previewButton.setActionCommand(CMD_PREVIEW);
this.previewButton.addActionListener(this);
JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]"));
loginPanel.add(this.statusLabel, "sg lbl");
loginPanel.add(this.statusField, "sg fd, grow");
loginPanel.add(this.descField, "span, grow");
loginPanel.add(this.previewButton, "gaptop 5px, span, split 3, align center");
loginPanel.setBorder(BorderFactory.createTitledBorder("登陆管理"));
JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]"));
this.setLayout(new MigLayout("wrap 1"));
panel.add(loginPanel);
panel.add(this.okButton, "gaptop 5px, span, split 3, align center");
panel.add(this.cancelButton);
this.add(panel, "width 100%, height 100%");
}
示例26
public void init() {
this.setTitle("充值管理");
this.setSize(900, 280);
Point p = WindowUtils.getPointForCentering(this);
this.setLocation(p);
this.setModal(true);
this.okButton.setActionCommand(ActionName.OK.name());
this.okButton.addActionListener(this);
this.cancelButton.setActionCommand(ActionName.CANCEL.name());
this.cancelButton.addActionListener(this);
this.infoField.setText(info);
this.infoField.setEditable(false);
JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]"));
loginPanel.add(this.statusLabel, "sg lbl");
loginPanel.add(this.valueField, "sg fd, width 10%");
loginPanel.setBorder(BorderFactory.createTitledBorder("充值管理"));
JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]"));
this.setLayout(new MigLayout("wrap 1"));
panel.add(loginPanel, "growx");
panel.add(infoField, "grow");
panel.add(this.okButton, "gaptop 5px, span, split 3, align center");
panel.add(this.cancelButton);
this.add(panel, "width 100%, height 100%");
}
示例27
public TemplateService() {
panel = new JXPanel();
panel.setLayout(new MigLayout("wrap 1"));
panel.add(label, "growx, wrap 20");
panel.add(progressBar, "grow, push");
this.dialog = new JDialog();
this.dialog.add(panel);
this.dialog.setSize(300, 120);
Point p = WindowUtils.getPointForCentering(dialog);
this.dialog.setLocation(p);
this.dialog.setModal(true);
this.dialog.setResizable(false);
this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
示例28
public void init() {
JXPanel settingPanel = new JXPanel();
TitledBorder border = BorderFactory.createTitledBorder(
BorderFactory.createEtchedBorder(), "服务器设定");
border.setTitleFont(MainFrame.BIG_FONT);
settingPanel.setBorder(border);
this.okButton.setActionCommand(ActionName.OK.name());
this.okButton.addActionListener(this);
settingPanel.setLayout(new MigLayout("wrap 4, gap 10px, alignx center", ""));
settingPanel.add(this.lblGameServer, "sg lb");
settingPanel.add(this.gameServerField, "sg fd, growx, pushx");
settingPanel.add(this.lblGamePort, "sg lb");
settingPanel.add(this.gameServerPort, "sg fd, growx, pushx");
JXPanel configPanel = new JXPanel();
TitledBorder backupBorder = BorderFactory.createTitledBorder("配置文件");
backupBorder.setTitleFont(MainFrame.BIG_FONT);
configPanel.setBorder(backupBorder);
configPanel.setLayout(new MigLayout("wrap 4, align center"));
JXPanel collPanel = new JXPanel();
collPanel.setLayout(new MigLayout("wrap 4, align center"));
collPanel.setBorder(BorderFactory.createEtchedBorder());
for ( int i=0; i<CONFIG_NAMES.length; i++ ) {
String collection = CONFIG_NAMES[i];
backupCollections[i] = new JCheckBox(collection);
collPanel.add(backupCollections[i], "sg checkbox");
}
configPanel.add(collPanel, "align center, width 100%");
configPanel.add(this.okButton, "newline, span, split 2, alignx center, aligny bottom");
this.setLayout(new MigLayout("wrap 1"));
this.add(settingPanel, "width 100%");
this.add(configPanel, "width 100%");
}
示例29
public void init() {
ToolTipManager.sharedInstance().setDismissDelay(86400000);
this.combatCountField.setValue(10);
this.levelField.setValue(5);
this.strengthField.setValue(5);
this.startBtn.addActionListener(this);
this.startBtn.setActionCommand(ActionName.OK.name());
this.myTable.setTableModel(myTableModel);
this.myTable.setEnableAddRow(false);
this.myTable.setEnableDelRow(true);
this.myTable.setEnableSaveButton(false);
this.myTable.setEditable(true);
this.myTable.setEnableRrefresh(true);
this.myTable.setRefreshAction(new WeaponBalanceTableRefreshAction(myTable));
this.myTable.getTable().setDefaultRenderer(Object.class, new BlanceResultRenderer());
this.myTable.getTable().setEditorFactory(displayDialog);
JXPanel userPanel = new JXPanel(new MigLayout("wrap 2"));
userPanel.add(user1Panel, "width 50%, height 100%, grow");
userPanel.add(user2Panel, "width 50%, height 100%, grow");
this.setLayout(new MigLayout("wrap 2"));
this.add(userPanel, "span, width 100%, height 30%");
this.add(combatCountLabel, "span, split 7");
this.add(combatCountField, "width 10%");
this.add(levelLabel, "width 10%");
this.add(levelField, "width 10%");
this.add(strengthLabel, "width 10%");
this.add(strengthField, "width 10%");
this.add(startBtn, "width 10%");
this.add(myTable, "span, width 100%, height 70%, grow");
}
示例30
public void init() {
//创建工作区域
this.setLayout(new MigLayout(""));
LoginManager.getInstance().reload();
this.majorVersionField.setValue(LoginManager.getInstance().getClientMajorVersion());
this.minorVersionField.setValue(LoginManager.getInstance().getClientMinorVersion());
this.configVersionField.setValue(LoginManager.getInstance().getClientConfigVersion());
this.clientVersionOKButton.setActionCommand(ActionName.OK.name());
this.clientVersionOKButton.addActionListener(this);
this.bulletinField.setColumns(100);
this.bulletinField.setRows(20);
this.sendButton.setActionCommand(ACTION_SEND);
this.sendButton.addActionListener(this);
this.sendButton.setText("发送");
this.expireField.setValue(0);
JXPanel versionPanel = new JXPanel(new MigLayout("wrap 4"));
versionPanel.setBorder(BorderFactory.createTitledBorder("登陆管理"));
versionPanel.add(clientVersionLabel, "width 25%");
versionPanel.add(majorVersionField, "width 10%");
versionPanel.add(minorVersionField, "width 10%");
versionPanel.add(configVersionLabel, "newline, width 25%");
versionPanel.add(configVersionField, "width 20%, wrap");
versionPanel.add(clientVersionOKButton, "width 10%, align center");
JXPanel bulletinPanel = new JXPanel(new MigLayout("wrap 1"));
bulletinPanel.setBorder(BorderFactory.createTitledBorder("消息管理"));
bulletinPanel.add(bulletinField, "grow");
bulletinPanel.add(typeField, "split 4");
bulletinPanel.add(expireField, "width 5%");
bulletinPanel.add(serverBox, "");
bulletinPanel.add(sendButton, "align center");
this.add(versionPanel, "width 100%, wrap");
this.add(bulletinPanel, "width 100%");
}