0% found this document useful (0 votes)
6 views2 pages

Package JavaGUI

This document contains a Java Swing application that creates a simple GUI frame with fields for user input. The frame includes labels for 'Name', 'Email Address', 'Country', 'City', and 'Address', along with corresponding text fields for user entry. The application is set to launch a window displaying these components when executed.

Uploaded by

Winter Equinox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Package JavaGUI

This document contains a Java Swing application that creates a simple GUI frame with fields for user input. The frame includes labels for 'Name', 'Email Address', 'Country', 'City', and 'Address', along with corresponding text fields for user entry. The application is set to launch a window displaying these components when executed.

Uploaded by

Winter Equinox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

package JavaGUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class javaFrame extends JFrame


{

private JPanel contentPane;


private JTextField textField;
private JTextField textField_1;
private JTextField textField_2;
private JTextField textField_3;
private JTextField textField_4;

/**
* Launch the application.
*/
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
try
{
javaFrame frame = new javaFrame();
frame.setVisible(true);
} catch (Exception e)
{
e.printStackTrace();
}
}
});
}

/**
* Create the frame.
*/
public javaFrame()
{
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("Name:");
lblNewLabel.setBounds(41, 45, 98, 14);
contentPane.add(lblNewLabel);

JLabel lblNewLabel_1 = new JLabel("Email Address:");


lblNewLabel_1.setBounds(41, 83, 98, 14);
contentPane.add(lblNewLabel_1);

JLabel lblNewLabel_2 = new JLabel("Country:");


lblNewLabel_2.setBounds(41, 131, 98, 14);
contentPane.add(lblNewLabel_2);

JLabel lblNewLabel_3 = new JLabel("City:");


lblNewLabel_3.setBounds(41, 174, 98, 14);
contentPane.add(lblNewLabel_3);

JLabel lblNewLabel_4 = new JLabel("Address:");


lblNewLabel_4.setBounds(41, 222, 98, 14);
contentPane.add(lblNewLabel_4);

textField = new JTextField();


textField.setBounds(250, 42, 151, 20);
contentPane.add(textField);
textField.setColumns(10);

textField_1 = new JTextField();


textField_1.setBounds(250, 80, 151, 20);
contentPane.add(textField_1);
textField_1.setColumns(10);

textField_2 = new JTextField();


textField_2.setBounds(250, 128, 151, 20);
contentPane.add(textField_2);
textField_2.setColumns(10);

textField_3 = new JTextField();


textField_3.setBounds(250, 171, 151, 20);
contentPane.add(textField_3);
textField_3.setColumns(10);

textField_4 = new JTextField();


textField_4.setBounds(250, 219, 151, 20);
contentPane.add(textField_4);
textField_4.setColumns(10);

JEditorPane editorPane = new JEditorPane();


editorPane.setBounds(0, 0, 434, 261);
contentPane.add(editorPane);
}
}

You might also like