Skip to content

Commit 0723ed2

Browse files
committed
Add Flatlaf dependency + changes in InitFrame
1 parent 22c2bb2 commit 0723ed2

3 files changed

Lines changed: 76 additions & 54 deletions

File tree

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
<artifactId>sqlite-jdbc</artifactId>
2121
<version>3.46.1.3</version>
2222
</dependency>
23+
24+
<!-- Flatlaf interface -->
25+
<dependency>
26+
<groupId>com.formdev</groupId>
27+
<artifactId>flatlaf</artifactId>
28+
<version>3.0</version>
29+
</dependency>
2330
</dependencies>
2431

2532
<build>
@@ -42,6 +49,7 @@
4249
<excludes>
4350
<exclude>META-INF/MANIFEST.MF</exclude>
4451
<exclude>META-INF/versions/9/module-info.class</exclude>
52+
<exclude>module-info.class</exclude>
4553
</excludes>
4654
</filter>
4755
</filters>

src/main/java/com/devparada/frame/InitFrame.form

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<Properties>
55
<Property name="defaultCloseOperation" type="int" value="3"/>
66
<Property name="title" type="java.lang.String" value="StatusMCServerTool"/>
7-
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
8-
<Color blue="2a" green="1b" red="d" type="rgb"/>
7+
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
8+
<Color id="Cursor Por defecto"/>
99
</Property>
1010
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
1111
<Dimension value="[759, 403]"/>
1212
</Property>
13+
<Property name="name" type="java.lang.String" value="initFrame" noResource="true"/>
1314
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
1415
<Dimension value="[759, 403]"/>
1516
</Property>
@@ -29,22 +30,30 @@
2930
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
3031
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
3132
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
32-
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-124,0,0,1,-29"/>
33+
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-81,0,0,1,-29"/>
3334
</AuxValues>
3435

35-
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
36+
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
3637
<SubComponents>
3738
<Container class="javax.swing.JScrollPane" name="jScrollPane">
3839
<Properties>
40+
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
41+
<Color blue="3b" green="26" red="1b" type="rgb"/>
42+
</Property>
3943
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
4044
</Properties>
45+
<Constraints>
46+
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
47+
<BorderConstraints direction="Center"/>
48+
</Constraint>
49+
</Constraints>
4150

4251
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
4352
<SubComponents>
4453
<Container class="javax.swing.JPanel" name="jPnlMain">
4554
<Properties>
46-
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
47-
<Color blue="ff" green="33" red="33" type="rgb"/>
55+
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
56+
<Color blue="3b" green="26" red="1b" type="rgb"/>
4857
</Property>
4958
</Properties>
5059

@@ -65,24 +74,19 @@
6574
<Layout>
6675
<DimensionLayout dim="0">
6776
<Group type="103" groupAlignment="0" attributes="0">
68-
<Group type="102" attributes="0">
69-
<EmptySpace pref="155" max="32767" attributes="0"/>
70-
<Group type="103" groupAlignment="1" attributes="0">
71-
<Component id="jBtnIntroAdd" min="-2" pref="162" max="-2" attributes="0"/>
72-
<Component id="jLblLoading" min="-2" pref="154" max="-2" attributes="0"/>
73-
</Group>
74-
<EmptySpace pref="163" max="32767" attributes="0"/>
77+
<Group type="102" alignment="0" attributes="0">
78+
<EmptySpace pref="156" max="32767" attributes="0"/>
79+
<Component id="jBtnIntroAdd" min="-2" pref="162" max="-2" attributes="0"/>
80+
<EmptySpace pref="162" max="32767" attributes="0"/>
7581
</Group>
7682
</Group>
7783
</DimensionLayout>
7884
<DimensionLayout dim="1">
7985
<Group type="103" groupAlignment="0" attributes="0">
8086
<Group type="102" alignment="1" attributes="0">
81-
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
87+
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
8288
<Component id="jBtnIntroAdd" min="-2" pref="33" max="-2" attributes="0"/>
83-
<EmptySpace type="separate" max="-2" attributes="0"/>
84-
<Component id="jLblLoading" min="-2" max="-2" attributes="0"/>
85-
<EmptySpace pref="32" max="32767" attributes="0"/>
89+
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
8690
</Group>
8791
</Group>
8892
</DimensionLayout>
@@ -114,6 +118,21 @@
114118
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnIntroAddActionPerformed"/>
115119
</Events>
116120
</Component>
121+
</SubComponents>
122+
</Container>
123+
<Container class="javax.swing.JPanel" name="jPnlInfo">
124+
<Properties>
125+
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
126+
<Color blue="3b" green="26" red="1b" type="rgb"/>
127+
</Property>
128+
</Properties>
129+
<AuxValues>
130+
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JPanel()"/>
131+
<AuxValue name="JavaCodeGenerator_LayoutCodePost" type="java.lang.String" value="jPnlMain.setBorder(javax.swing.BorderFactory.createEmptyBorder());"/>
132+
</AuxValues>
133+
134+
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
135+
<SubComponents>
117136
<Component class="javax.swing.JLabel" name="jLblLoading">
118137
<Properties>
119138
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
@@ -128,20 +147,6 @@
128147
</Component>
129148
</SubComponents>
130149
</Container>
131-
<Container class="javax.swing.JPanel" name="jPnlInfo">
132-
<Properties>
133-
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
134-
<Color blue="3b" green="26" red="1b" type="rgb"/>
135-
</Property>
136-
</Properties>
137-
<AuxValues>
138-
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JPanel()"/>
139-
</AuxValues>
140-
141-
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
142-
<Property name="axis" type="int" value="1"/>
143-
</Layout>
144-
</Container>
145150
</SubComponents>
146151
</Container>
147152
</SubComponents>

src/main/java/com/devparada/frame/InitFrame.java

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.devparada.logic.ImageServer;
2020
import com.devparada.logic.StatusMCServer;
2121
import com.devparada.persistency.DBManager;
22+
import com.formdev.flatlaf.FlatDarkLaf;
2223
import java.awt.Color;
2324
import java.awt.GridBagConstraints;
2425
import java.awt.image.BufferedImage;
@@ -30,6 +31,8 @@
3031
import javax.swing.JPanel;
3132
import javax.swing.JTextField;
3233
import javax.swing.SwingUtilities;
34+
import javax.swing.UIManager;
35+
import javax.swing.UnsupportedLookAndFeelException;
3336
import javax.swing.border.EmptyBorder;
3437

3538
/**
@@ -63,20 +66,21 @@ private void initComponents() {
6366
jPnlMain = new javax.swing.JPanel();
6467
jPanelIntro = new javax.swing.JPanel();
6568
jBtnIntroAdd = new javax.swing.JButton();
66-
jLblLoading = new javax.swing.JLabel();
6769
jPnlInfo = new javax.swing.JPanel();
70+
jLblLoading = new javax.swing.JLabel();
6871

6972
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
7073
setTitle("StatusMCServerTool");
71-
setBackground(new java.awt.Color(13, 27, 42));
74+
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
7275
setMinimumSize(new java.awt.Dimension(759, 403));
76+
setName("initFrame"); // NOI18N
7377
setPreferredSize(new java.awt.Dimension(759, 403));
7478
setResizable(false);
75-
getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));
7679

80+
jScrollPane.setBackground(new java.awt.Color(27, 38, 59));
7781
jScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
7882

79-
jPnlMain.setForeground(new java.awt.Color(51, 51, 255));
83+
jPnlMain.setBackground(new java.awt.Color(27, 38, 59));
8084
jPnlMain.setLayout(new javax.swing.BoxLayout(jPnlMain, javax.swing.BoxLayout.Y_AXIS));
8185

8286
jPanelIntro.setBackground(new java.awt.Color(27, 38, 59));
@@ -95,41 +99,40 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
9599
}
96100
});
97101

98-
jLblLoading.setBackground(new java.awt.Color(222, 222, 222));
99-
jLblLoading.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
100-
jLblLoading.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
101-
jLblLoading.setText("Loading...");
102-
103102
javax.swing.GroupLayout jPanelIntroLayout = new javax.swing.GroupLayout(jPanelIntro);
104103
jPanelIntro.setLayout(jPanelIntroLayout);
105104
jPanelIntroLayout.setHorizontalGroup(
106105
jPanelIntroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
107106
.addGroup(jPanelIntroLayout.createSequentialGroup()
108-
.addContainerGap(155, Short.MAX_VALUE)
109-
.addGroup(jPanelIntroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
110-
.addComponent(jBtnIntroAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
111-
.addComponent(jLblLoading, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
112-
.addContainerGap(163, Short.MAX_VALUE))
107+
.addContainerGap(156, Short.MAX_VALUE)
108+
.addComponent(jBtnIntroAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
109+
.addContainerGap(162, Short.MAX_VALUE))
113110
);
114111
jPanelIntroLayout.setVerticalGroup(
115112
jPanelIntroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
116113
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelIntroLayout.createSequentialGroup()
117-
.addGap(27, 27, 27)
114+
.addGap(16, 16, 16)
118115
.addComponent(jBtnIntroAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
119-
.addGap(18, 18, 18)
120-
.addComponent(jLblLoading)
121-
.addContainerGap(32, Short.MAX_VALUE))
116+
.addGap(40, 40, 40))
122117
);
123118

124119
jPnlMain.add(jPanelIntro);
125120

126121
jPnlInfo.setBackground(new java.awt.Color(27, 38, 59));
127-
jPnlInfo.setLayout(new javax.swing.BoxLayout(jPnlInfo, javax.swing.BoxLayout.Y_AXIS));
122+
123+
jLblLoading.setBackground(new java.awt.Color(222, 222, 222));
124+
jLblLoading.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
125+
jLblLoading.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
126+
jLblLoading.setText("Loading...");
127+
jPnlInfo.add(jLblLoading);
128+
129+
jPnlMain.setBorder(javax.swing.BorderFactory.createEmptyBorder());
130+
128131
jPnlMain.add(jPnlInfo);
129132

130133
jScrollPane.setViewportView(jPnlMain);
131134

132-
getContentPane().add(jScrollPane);
135+
getContentPane().add(jScrollPane, java.awt.BorderLayout.CENTER);
133136

134137
pack();
135138
}// </editor-fold>//GEN-END:initComponents
@@ -150,12 +153,18 @@ public static void main(String args[]) {
150153
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
151154
*/
152155
try {
156+
/*
153157
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
154158
if ("Nimbus".equals(info.getName())) {
155159
javax.swing.UIManager.setLookAndFeel(info.getClassName());
156160
break;
157161
}
158-
}
162+
}*/
163+
UIManager.setLookAndFeel(new FlatDarkLaf());
164+
} catch (UnsupportedLookAndFeelException ex) {
165+
java.util.logging.Logger.getLogger(InitFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
166+
}
167+
/*
159168
} catch (ClassNotFoundException ex) {
160169
java.util.logging.Logger.getLogger(InitFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
161170
} catch (InstantiationException ex) {
@@ -164,14 +173,14 @@ public static void main(String args[]) {
164173
java.util.logging.Logger.getLogger(InitFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
165174
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
166175
java.util.logging.Logger.getLogger(InitFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
167-
}
176+
}*/
168177
//</editor-fold>
169178

170179
/* Create and display the form */
171180
java.awt.EventQueue.invokeLater(() -> {
172181
InitFrame initFrame = new InitFrame();
173182
initFrame.setLocationRelativeTo(null);
174-
initFrame.setBackground(new java.awt.Color(51, 102, 255)); // Green button
183+
initFrame.setBackground(new java.awt.Color(27, 38, 59));
175184
initFrame.setVisible(true);
176185
initFrame.start();
177186
});

0 commit comments

Comments
 (0)