commit 1765dd55621890013ff1aaea8b87c63456b3cfab
parent cb1a1613669424224e1d4fcaf2e4cc361c6f5b49
Author: Michael Neuper <michael@michaelneuper.com>
Date: Fri, 12 May 2023 17:09:45 +0200
Change font to build in menu
Diffstat:
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/view/MenuUI.form b/src/view/MenuUI.form
@@ -38,7 +38,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="225" max="-2" attributes="0"/>
<Component id="jLabelMenu" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="231" max="32767" attributes="0"/>
+ <EmptySpace pref="223" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -56,7 +56,7 @@
<Component class="javax.swing.JLabel" name="jLabelMenu">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
- <Font name="Segoe UI" size="48" style="0"/>
+ <Font name="Segoe UI" size="48" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="Menu"/>
</Properties>
@@ -109,6 +109,9 @@
</Property>
<Property name="text" type="java.lang.String" value="STATISTICS"/>
</Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonStatisticsActionPerformed"/>
+ </Events>
</Component>
<Component class="javax.swing.JButton" name="jButtonRules">
<Properties>
diff --git a/src/view/MenuUI.java b/src/view/MenuUI.java
@@ -9,7 +9,7 @@ import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
/**
- * GUI to show the following options:
+ * GUI to display the following options:
* <ul>
* <li>Statistics</li>
* <li>Rules</li>
@@ -48,7 +48,7 @@ public class MenuUI extends javax.swing.JFrame {
setTitle("Menu");
setAlwaysOnTop(true);
- jLabelMenu.setFont(new java.awt.Font("Segoe UI", 0, 48)); // NOI18N
+ jLabelMenu.setFont(new java.awt.Font("Segoe UI", 1, 48)); // NOI18N
jLabelMenu.setText("Menu");
javax.swing.GroupLayout jPanelNorthLayout = new javax.swing.GroupLayout(jPanelNorth);
@@ -58,7 +58,7 @@ public class MenuUI extends javax.swing.JFrame {
.addGroup(jPanelNorthLayout.createSequentialGroup()
.addGap(225, 225, 225)
.addComponent(jLabelMenu)
- .addContainerGap(231, Short.MAX_VALUE))
+ .addContainerGap(223, Short.MAX_VALUE))
);
jPanelNorthLayout.setVerticalGroup(
jPanelNorthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -73,6 +73,11 @@ public class MenuUI extends javax.swing.JFrame {
jButtonStatistics.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N
jButtonStatistics.setIcon(new javax.swing.ImageIcon(getClass().getResource("/assets/icons/stats.png"))); // NOI18N
jButtonStatistics.setText("STATISTICS");
+ jButtonStatistics.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonStatisticsActionPerformed(evt);
+ }
+ });
jButtonRules.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N
jButtonRules.setIcon(new javax.swing.ImageIcon(getClass().getResource("/assets/icons/question.png"))); // NOI18N
@@ -120,7 +125,6 @@ public class MenuUI extends javax.swing.JFrame {
try {
// get the user's default browser
Desktop desktop = Desktop.getDesktop();
-
// open the URL in the default browser
desktop.browse(new URI("https://github.com/michaelneuper/librejack"));
} catch (IOException | URISyntaxException e) {
@@ -128,6 +132,10 @@ public class MenuUI extends javax.swing.JFrame {
}
}//GEN-LAST:event_jButtonSourceActionPerformed
+ private void jButtonStatisticsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStatisticsActionPerformed
+ new StatisticsUI().setVisible(true);
+ }//GEN-LAST:event_jButtonStatisticsActionPerformed
+
/**
* @param args the command line arguments
*/