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.FlowLa yout;
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("NewC onnection");
JMenuItem recentconnectio n=new JMenuItem("Rece ntConnection");
JMenuItem closeconnection =new JMenuItem("Clos eConnections");
JMenuItem exit=new JMenuItem("Exit ");
JFrame frame1 = new JFrame();
JDesktopPane desktop = new JDesktopPane();
JButton btn1=new JButton("Port1" );
void run(){
frame.setJMenuB ar(mb);
mb.add(file);
mb.add(edit);
mb.add(view);
mb.add(tools);
mb.add(help);
file.add(newcon nection);
file.add(recent connection);
file.add(closec onnection);
file.add(exit);
frame.add(btn1) ;
btn1.addActionL istener(new ActionListener( ){
public void actionPerformed (ActionEvent e) {
ServerInitiator ser=new ServerInitiator ();
ser.initialize( 6666);
}
});
frame.setDefaul tCloseOperation (JFrame.EXIT_ON _CLOSE);
frame.setExtend edState(frame.g etExtendedState ()|JFrame.MAXIM IZED_BOTH);
frame.setLayout (new FlowLayout());
frame.setSize(4 00, 125);
frame.setVisibl e(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
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.FlowLa yout;
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("NewC onnection");
JMenuItem recentconnectio n=new JMenuItem("Rece ntConnection");
JMenuItem closeconnection =new JMenuItem("Clos eConnections");
JMenuItem exit=new JMenuItem("Exit ");
JFrame frame1 = new JFrame();
JDesktopPane desktop = new JDesktopPane();
JButton btn1=new JButton("Port1" );
void run(){
frame.setJMenuB ar(mb);
mb.add(file);
mb.add(edit);
mb.add(view);
mb.add(tools);
mb.add(help);
file.add(newcon nection);
file.add(recent connection);
file.add(closec onnection);
file.add(exit);
frame.add(btn1) ;
btn1.addActionL istener(new ActionListener( ){
public void actionPerformed (ActionEvent e) {
ServerInitiator ser=new ServerInitiator ();
ser.initialize( 6666);
}
});
frame.setDefaul tCloseOperation (JFrame.EXIT_ON _CLOSE);
frame.setExtend edState(frame.g etExtendedState ()|JFrame.MAXIM IZED_BOTH);
frame.setLayout (new FlowLayout());
frame.setSize(4 00, 125);
frame.setVisibl e(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
Comment