Code 1:
public static JFrame frame = null;
public myClass(JFrame frame1)
{
initComponents();
frame = frame1;
String result = JOptionPane.showInternalInputDialog(
frame.getContentPane(), "Sample");
}
Code 2:
public static JFrame frame = null;
public myClass(JFrame frame1)
{
initComponents();
frame = frame1;
sampleMethod();
}
public static void sampleMethod()
{
String result = JOptionPane.showInternalInputDialog(
frame.getContentPane(), "Sample");
}
I wanted the result in Code 1 but the code must look like Code 2. Why do they have different results?