File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 2
2
import javax .swing .*;
3
3
import java .awt .event .*;
4
4
5
- public class Main extends JFrame {
5
+ public class Main extends JFrame {
6
6
// Menubar
7
7
static JMenuBar menuBar ;
8
8
@@ -48,7 +48,7 @@ public class Main extends JFrame {
48
48
49
49
setTitle ("Eightsoft" );
50
50
setSize (800 , 800 );
51
- // setLocation(200, 100 );
51
+ setLocation (300 , 5 );
52
52
setVisible (true );
53
53
setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
54
54
}
@@ -64,6 +64,7 @@ public void actionPerformed(ActionEvent e) {
64
64
else if (e .getSource () == menuItem2 ) {
65
65
// Creating Object
66
66
Sorting sort = new Sorting ();
67
+ setVisible (false ); // will close the previous window
67
68
System .out .println ("Menu Item 2 choosed" );
68
69
}
69
70
else if (e .getSource () == menuItem2 ) {
Original file line number Diff line number Diff line change @@ -54,15 +54,9 @@ public class Sorting extends Main {
54
54
pPanel1 .setBackground (Color .CYAN );
55
55
pPanel2 .setBackground (Color .YELLOW );
56
56
57
- // pPanel1.add(p1Sorting);
58
- // pPanel2.add(p2Sorting);
59
- // p1Sorting.setVisible(true);
60
- // p2Sorting.setVisible(true);
61
-
62
57
// Add Panels to the panel
63
58
add (pPanel1 , BorderLayout .NORTH );
64
59
add (pPanel2 , BorderLayout .CENTER );
65
60
66
61
}
67
-
68
62
}
You can’t perform that action at this time.
0 commit comments