Вы находитесь на странице: 1из 4

NetBeans Ide Projects

JAVA PROGRAMS

Q1 (My Favourite Place)

On a Frame bring 2 labels from Palette Window.


On 1st Label, press F2 to give heading of your jFrame Form
i.e. MY FAVOURITE PLACE and go to the property by
clicking right button of your mouse in that label only. Now
you adjust your label according to your choice (such as:Background color, foreground color, text, fonts, etc.)
Then with 2nd Label change its size with the help of mouse
in big rectangular / square form. Press F2 for clear the text.
Then go to property by right click of your mouse. Go to icon
-> External Image -> click on browser local disk, a dialog
box will appear on the screen, then select your photo from
your disk and click on open button. After that press OK
button. Your photo will be visible on 2nd Label, Hence, your
program is ready

Q2 (My Personal Information Application)

SUBMIT :-String name=t1.getText();


int age=Integer.parseInt(t2.getText());
String address=t3.getText();
long mobile = Long.parseLong(t4.getText());
String email=t5.getText();
ta1.append(""+name.toUpperCase()
+'\n'+""+age+'\n'+""+address.toUpperCase()+'\n
+""+mobile+'\n'+""+email+'\n'+'\n');

Q3 (Simple Calculator Application)

Add(+):-int n1,n2;
n1=Integer.parseInt(t1.getText());
n2=Integer.parseInt(t2.getText());
int r = n1+n2;
t3.setText(""+r);
Subtraction(-):-int n1,n2;
n1=Integer.parseInt(t1.getText());
n2=Integer.parseInt(t2.getText());
int r = n1-n2;
t3.setText(""+r);
Multiplication(*):-int n1,n2;
n1=Integer.parseInt(t1.getText());
n2=Integer.parseInt(t2.getText());
int r = n1*n2;
t3.setText(""+r);
Division(/):-int n1,n2;
n1=Integer.parseInt(t1.getText());
n2=Integer.parseInt(t2.getText());
int r = n1/n2;
t3.setText(""+r);

Вам также может понравиться