@@ -12,15 +12,15 @@ public static void main(String[] args){
1212
1313
1414class Window extends JFrame implements ActionListener {//inheriting JFrame
15- JFrame f ; // Window
15+ JFrame frame ; // Window
1616 JMenuBar menuBar ; // Object of Menu bar
1717 JMenu mainMenu , helpDesk ; // Part of Menu bar
1818 JMenuItem menu_1 ,menu_2 ,menu_3 ,menu_4 ; // Items of Menu
1919 JButton b ;
2020 JTextArea txtArea ;
2121
2222 Window () {
23- f = new JFrame ("Algorithm_Visualizer" );
23+ frame = new JFrame ("Algorithm_Visualizer" );
2424
2525 menuBar =new JMenuBar ();
2626 mainMenu = new JMenu ("Menu" );
@@ -42,15 +42,14 @@ class Window extends JFrame implements ActionListener {//inheriting JFrame
4242 mainMenu .add (menu_1 ); mainMenu .add (menu_2 ); mainMenu .add (menu_3 ); helpDesk .add (menu_4 );
4343 menuBar .add (mainMenu ); menuBar .add (helpDesk );
4444 // f.add(b);//adding button on frame
45- f .add (txtArea ); // adding text area on frame
46- f .setJMenuBar (menuBar );
47- f .setSize (400 ,400 );
48- f .setLayout (null );
49- f .setVisible (true );
45+ frame .add (txtArea ); // adding text area on frame
46+ frame .setJMenuBar (menuBar );
47+ frame .setSize (400 ,400 );
48+ frame .setLayout (null );
49+ frame .setVisible (true );
5050 }
5151
52- public void actionPerformed (ActionEvent entry ) // Functions for buttons
53- {
52+ public void actionPerformed (ActionEvent entry ) {
5453 if (entry .getSource ()==menu_1 )
5554 txtArea .cut ();
5655 if (entry .getSource ()==menu_2 )
@@ -62,4 +61,3 @@ public void actionPerformed(ActionEvent entry) // Functions for buttons
6261 }
6362}
6463
65-
0 commit comments