How do I output GUI?

I'm wondering how do I get the output to show on the screen?  I run this in JBuilder and nothing happens.  Please help!  Thanks!


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.*;

public class Program4  {
  public static void main(String[] args) {

    JLabel JLString1, JLString2, JLResults;
    JTextField JTFString1, JTFString2, JTFResults;
    JButton JBCompare, JBClear;
    JPanel Panel;
    String output = "";

    JLString1 = new JLabel("First String: ");
    JLString2 = new JLabel("Second String: ");
    JLResults = new JLabel("Results: ");
    JBCompare = new JButton("Compare Strings");
    JBClear = new JButton("Clear");
    JTFString1 = new JTextField(20);
    JTFString2 = new JTextField(20);
    JTFResults = new JTextField(30);
    Panel = new JPanel();

    JTFResults.setEditable(false);
    JTFString1.requestFocus();

    Panel.add(JLString1);
    Panel.add(JTFString1);
    Panel.add(JLString2);
    Panel.add(JTFString2);
    Panel.add(JBCompare);
    Panel.add(JBClear);
    Panel.add(JLResults);
    Panel.add(JTFResults);

    String String1 = JTFString1.getText();
    String String2 = JTFString2.getText();

  }
}
Job4SuprmnAsked:
Who is Participating?
 
expertmbCommented:
   JFrame frame = new JFrame();
    frame.getContentPane().add(Panel);
    frame.setSize(400,400);
    frame.setVisible(true);
0
 
expertmbCommented:
put the panel in jduailo or jframe then call setVisible(true)
0
 
expertmbCommented:
jduailo should be jdialog.
0
 
Job4SuprmnAuthor Commented:
That worked, thanks!  Here are your points.
0
 
expertmbCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.