Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit d470cd0

Browse files
committed
fix some bugs
1 parent 3d077c4 commit d470cd0

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

dependency-reduced-pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
<target>20</target>
4545
</configuration>
4646
</plugin>
47+
<plugin>
48+
<groupId>org.xolstice.maven.plugins</groupId>
49+
<artifactId>protobuf-maven-plugin</artifactId>
50+
<version>0.5.1</version>
51+
</plugin>
4752
</plugins>
4853
</build>
4954
<repositories>
@@ -59,12 +64,6 @@
5964
</repository>
6065
</repositories>
6166
<dependencies>
62-
<dependency>
63-
<groupId>mysql</groupId>
64-
<artifactId>mysql-connector-java</artifactId>
65-
<version>8.0.33</version>
66-
<scope>compile</scope>
67-
</dependency>
6867
<dependency>
6968
<groupId>org.junit.jupiter</groupId>
7069
<artifactId>junit-jupiter-api</artifactId>

src/main/java/top/mryan2005/managesysteminjava/Core.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import java.awt.event.*;
66
import javax.swing.*;
77

8+
import static java.lang.Integer.valueOf;
9+
810
public class Core extends JFrame {
911

1012
public void print(String str) {
@@ -14,7 +16,7 @@ public void print(String str) {
1416
public String printPath() {
1517
String path = String.valueOf(this.getClass().getClassLoader().getResource(""));
1618
if(path.matches("file:(.*)/classes/")) {
17-
path = path.substring(6, path.length() - 15)+"/src/main/resources/top/mryan2005/managesysteminjava/";
19+
path = path.substring(6, path.length() - 15)+"src/main/resources/top/mryan2005/managesysteminjava/";
1820
} else if(path == "null") {
1921
path = "";
2022
}
@@ -24,36 +26,38 @@ public String printPath() {
2426

2527
public void buildWindows() {
2628
ImageIcon icon=new ImageIcon(printPath()+"1.png");
27-
print(printPath()+"1.png");
2829
JLabel label=new JLabel(icon);
2930
label.setBounds(0,0,1729,972);
3031
Container container = getContentPane();
32+
container.setSize(1729,972);
3133
container.setLayout(new BorderLayout());
3234
((JPanel)container).setOpaque(false);
33-
getLayeredPane().add(label,new Integer(Integer.MIN_VALUE));
35+
getLayeredPane().add(label, valueOf(Integer.MIN_VALUE));
3436
JMenuBar jMenuBar = new JMenuBar();
3537
setJMenuBar(jMenuBar);
3638
JMenu jMenu = new JMenu("File");
37-
jMenuBar.add(jMenu);
3839
JMenuItem jMenuItemExit = new JMenuItem("Exit");
3940
jMenu.add(jMenuItemExit);
41+
jMenuBar.add(jMenu);
4042
JMenu jMenu2 = new JMenu("About");
4143
jMenuBar.add(jMenu2);
4244
JMenuItem jMenuItemAbout = new JMenuItem("New Issue");
4345
jMenu2.add(jMenuItemAbout);
4446
jMenuItemAbout.addActionListener(this::newIssue);
4547
jMenuItemExit.addActionListener(this::actionPerformed);
46-
// build a dock bar like Mac OS
48+
// build a dock bar like macOS
4749
// Create the dock bar
4850
JPanel dockBar = new JPanel();
51+
dockBar.setPreferredSize(new Dimension(0, 100));
52+
dockBar.setSize(120, 80);
4953
dockBar.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
50-
dockBar.setBackground(new Color(0, 0, 0, 0)); // Transparent background
51-
54+
dockBar.setBackground(new Color(0, 0, 0, 20)); // Transparent background
55+
dockBar.setOpaque(true);
5256
// Add buttons to the dock bar
5357
for (int i = 1; i <= 5; i++) {
54-
JButton button = new JButton(new ImageIcon(printPath() + "/icon" + i + ".jpg"));
58+
JButton button = new JButton(new ImageIcon(printPath() + "/icons/" + i + ".png"));
5559
button.setSize(50, 50);
56-
button.setContentAreaFilled(false);
60+
button.setContentAreaFilled(true);
5761
button.setBorderPainted(false);
5862
button.setFocusPainted(false);
5963
button.setOpaque(true);
Loading

0 commit comments

Comments
 (0)