Upload
nag
View
3
Download
0
Embed Size (px)
DESCRIPTION
Jbuttons, Advanced java, SwingsJTextfiels, JPanel , JFrame and Student
Citation preview
7/17/2019 Java Swings Examples_ Creating Components
http://slidepdf.com/reader/full/java-swings-examples-creating-components 1/2
Java Swings Concepts -- Exercises
Exercise Questions
1. Write a java program to obtain the display as shown below.
import java.awt.low!ayout"
import java.awt.#rid!ayout"
import javax.swing.J$utton"
import javax.swing.Jrame"
import javax.swing.J!abel"
import javax.swing.J%extield"
public class Q&'Student(n)o extends Jrame *
++Constructor
public Q&'Student(n)o, *
++ rows / column and 0 pixel gap between each
set!ayout,new #rid!ayout,1 /1 01 0"
++2dd labels and text 3elds to the )rame
add,new J!abel,45ame4"
add,new J%extield,6"
add,new J!abel,4Score4"
add,new J%extield,6"
7/17/2019 Java Swings Examples_ Creating Components
http://slidepdf.com/reader/full/java-swings-examples-creating-components 2/2
Java Swings Concepts -- Exercises
add,new J$utton,4#et Score4"
add,new J$utton,4Save Student4"
7
public static void main,String89 args *
++ %:;: code application logic here
Q&'Student(n)o )rame < new Q&'Student(n)o,"
)rame.set%itle,4Student (n)ormation4"
)rame.setSi=e,>>1 /0>"
)rame.set!ocation?elative%o,null"
)rame.set;e)aultClose:peration,Jrame.E@(%':5'C!:SE"
)rame.setAisible,true"
7
7
:utputB