SWING FRMES

Ads
 

SWING FRMES

hai SIR? HOW TO DESIGN swing Frames send source code

View Answers

July 13, 2012 at 11:14 AM

Here is a simple example of java swing. The given code creates a frame which is composed of some swing components.

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

public class SwingFrame{
public static void main(String[] args) throws Exception{
SwingFrame sf=new SwingFrame();
}

public SwingFrame(){
JFrame f = new JFrame("Frame in Java Swing");
f.getContentPane().setLayout(null);
JLabel lbl1 = new JLabel("Name");
final JTextField jt1=new JTextField(15);
JLabel lbl2 = new JLabel("Address");
final JPasswordField jt2=new JPasswordField(15);
JLabel lbl3 = new JLabel("Contact No");
final JPasswordField jt3=new JPasswordField(15);
JLabel lbl4 = new JLabel("Gender");
final JRadioButton Male,Female;
ButtonGroup radioGroup=new ButtonGroup();
Male=new JRadioButton("Male");
radioGroup.add(Male);
Female=new JRadioButton("Female");
radioGroup.add(Female);
JButton button=new JButton("Submit");
lbl1.setBounds(50,50,70,20);
lbl2.setBounds(50,90,70,20);
lbl3.setBounds(50,130,70,20);
lbl4.setBounds(50,170,70,20);
button.setBounds(50,210,100,20);
jt1.setBounds(150,50,100,20);
jt2.setBounds(150,90,100,20);
jt3.setBounds(150,130,100,20);
Male.setBounds(150,170,100,20);
Female.setBounds(250,170,100,20);

f.add(lbl1);
f.add(lbl2);
f.add(lbl3);
f.add(lbl4);
f.add(jt1);
f.add(jt2);
f.add(jt3);
f.add(Male);
f.add(Female);
f.add(button);
f.setSize(500,500);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

Ads









Related Tutorials/Questions & Answers:
SWING FRMES
SWING FRMES  hai SIR? HOW TO DESIGN swing Frames send source code
SWING FRMES
SWING FRMES  hai SIR? HOW TO DESIGN swing Frames send source code
Advertisements
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
swing
swing  Write a java swing program to delete a selected record from a table
swing
swing  How to make swing component auto-resizable when JFrame resize
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
What is Swing?
What is Swing?  What is Java Swing? Where to get the tutorials of Swing? I am beginner in Java Swing programming and trying to find the tutorials of Swing. Tell me the urls to learn swing. Thanks   Hi, Swing is Java
swing sms
swing sms  HOW TO SEND SMS MESSAGE FROM SWING USING SQL DATABASE
Swing Program
Swing Program  Write a java swing program to calculate the age from given date of birth
swing to applet
swing to applet  hi how i can isplay a java swing into applet java thanks
java swing - Swing AWT
java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image....: http://www.roseindia.net/java/example/java/swing/ Thanks
java swing
java swing  view the book details using swing
printing in swing
printing in swing  How can i print payslip in swing
Jva swing
Jva swing   How to create the model form like "Notepad
swing program
swing program  Write a java swing program to getname and email id. Display the message if email id contains the name of theuser
java swing
java swing  what is java swing   Swing is a principal GUI toolkit for the Java programming language. It is a part of the JFC (Java... the following link: Swing Tutorials
Swing application
Swing application  Hello, I want to develop a Swing application similar to J2EE application.The only difference is that, the users will access the application not through web browsers, instead through a Swing desktop application
Swing Program
Swing Program  write a java swing program to get user name and password. The name contains only characters while password is masked with the character "*". Apply checks for all validation
Swing Program
Swing Program  Write a java swing program that takes name and marks as input with all validation. The name and marks will be displayed in message box when user clicks on a button
Swing EJB
Swing EJB  Hi everyone !!! I tried to find wether EJB architecture can operate with swing, because I am trying to make application which would work as with swing client side, instead jsp or other web page page(s). I wondered
Java swing
Java swing  Write a java swing program to calculate the age from given date of birth
swing question
swing question  how to write multiple line text area in a single frame
Swing Program
Swing Program  Write a java swing program to search the details of the students. Searching is performed on student's first name. The details of all those students having same name as in given in searching criterion
Version of nanocontainer-swing>nanocontainer-swing dependency
List of Version of nanocontainer-swing>nanocontainer-swing dependency
java swing.
java swing.  Hi How SetBounds is used in java programs.The values in the setBounds refer to what? ie for example setBounds(30,30,30,30) and in that the four 30's refer to what
JAVA SWING
JAVA SWING  Hi.... Iam doing project in java...and my front end in swing ..our project is like billing software... then what are the topics i want cover? then how to design? pls help me
Swing Application
Swing Application  hello, i am making swing application in java i am unable to run prog......when my rite clikcing on my project name and clicking thn run it is not showing output .....and when i am cliking on individual java
Java swing
are displayed in the table..I need the source code in java swing
Java swing
to the database using java swing
swing program for decimal to binary
swing program for decimal to binary  swing program for decimal to binary

Ads