btnnew.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
System.out.println("Hello");
packetListener.listener();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
I get a black screen when it runs. But when the packetListener.listener(); calls in the constructor it shows.
Can you please explain why this is happening?
I think the
packetListener.listener();method performs some complex operation which blocks your UI.Better create a thread for listening the packet.
ie,use it like this
Hope this helps you