55import java .awt .event .*;
66import javax .swing .*;
77
8+ import static java .lang .Integer .valueOf ;
9+
810public 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 );
0 commit comments