Please help me
i have a problem that whenever i run this program and during execution if i click the button then the remainig menubar and menuitems will not respond all the actions are blocked
package desktop;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class SamplDesktop {
JFrame frame = new JFrame();
JMenuBar mb = new JMenuBar();
JMenu file = new JMenu("File");
JMenu edit = new JMenu("Edit");
JMenu view = new JMenu("View");
JMenu tools = new JMenu("Tools");
JMenu help = new JMenu("Help");
JMenuItem newconnection = new JMenuItem("NewConnection");
JMenuItem recentconnection=new JMenuItem("RecentConnection");
JMenuItem closeconnection=new JMenuItem("CloseConnections");
JMenuItem exit=new JMenuItem("Exit");
JFrame frame1 = new JFrame();
JDesktopPane desktop = new JDesktopPane();
JButton btn1=new JButton("Port1");
void run(){
frame.setJMenuBar(mb);
mb.add(file);
mb.add(edit);
mb.add(view);
mb.add(tools);
mb.add(help);
file.add(newconnection);
file.add(recentconnection);
file.add(closeconnection);
file.add(exit);
frame.add(btn1);
btn1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
ServerInitiator ser=new ServerInitiator();
ser.initialize(6666);
}
});
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.setExtendedState(frame.getExtendedState()|JF rame.MAXIMIZED_BOTH);
frame.setLayout(new FlowLayout());
frame.setSize(400, 125);
frame.setVisible(true);
}
public static void main(String[] args) {
SamplDesktop sd=new SamplDesktop();
sd.run();
}
}
i must access the object and the methods of the other class please help for me from this problem also
Thanks in Advance