添加鸣谢页面
This commit is contained in:
@@ -116,9 +116,18 @@ public class MenuBar extends JMenuBar {
|
||||
new MITDialog();
|
||||
}
|
||||
});
|
||||
JMenuItem thanksItem = new JMenuItem("鸣谢");
|
||||
thanksItem.addActionListener(
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
new AcademyThanksDialog();
|
||||
}
|
||||
}
|
||||
);
|
||||
aboutMenu.add(about);
|
||||
aboutMenu.add(author);
|
||||
aboutMenu.add(MITLicense);
|
||||
aboutMenu.add(thanksItem);
|
||||
|
||||
//将菜单加入菜单栏
|
||||
add(fileMenu);
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.msksbr.MainFrm.MenuItemDiaog.AcademyThanksDialog">
|
||||
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<xy x="48" y="54" width="436" height="297"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="94766" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="9538f" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="1">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="e7465" class="javax.swing.JButton" binding="buttonOK">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<text value="OK"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="e3588" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="75e6c" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="1">
|
||||
<constraints border-constraint="South"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="bd601" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<text value="新疆理工学院"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="51315" layout-manager="GridBagLayout">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="78840" class="javax.swing.JLabel" binding="imageLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<gridbag weightx="0.0" weighty="0.0"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.msksbr.MainFrm.MenuItemDiaog;
|
||||
|
||||
import com.msksbr.LoginFrm.ScreenSize;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
public class AcademyThanksDialog extends JDialog {
|
||||
private JPanel contentPane;
|
||||
private JButton buttonOK;
|
||||
private JLabel imageLabel;
|
||||
|
||||
public AcademyThanksDialog() {
|
||||
setTitle("鸣谢");
|
||||
setContentPane(contentPane);
|
||||
setModal(false);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
|
||||
buttonOK.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
onOK();
|
||||
}
|
||||
});
|
||||
imageLabel.setIcon(new ImageIcon("src/com/msksbr/images/academy_logo.png"));
|
||||
pack();
|
||||
setResizable(false);
|
||||
setLocation();
|
||||
setAlwaysOnTop(true);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
private void onOK() {
|
||||
// 在此处添加您的代码
|
||||
dispose();
|
||||
}
|
||||
|
||||
public void setLocation() {
|
||||
setLocation(new ScreenSize().width / 2 - getWidth() / 2, new ScreenSize().height / 2 - getHeight() / 2);
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ public class MITDialog extends JDialog {
|
||||
pack();
|
||||
setResizable(false);
|
||||
setLocation();
|
||||
setAlwaysOnTop(true);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user