tutorial101 is the one place for high quality web development, Web Design and software development tutorials and Resources programming. Learn cutting edge techniques in web development, design and software development, download source components and participate in the community.
public static void main(String args[]) {
String input = JOptionPane.showInputDialog("Enter your age");
int aga = Integer.parseInt(input);
if (age >=18){
JOptionPane.showMessageDialog(null,"You are an adult");
}else{
JOptionPane.showMessageDialog(null,"You are a minor");
}
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new JTextField_JFrame().setVisible(true);
}
});
}
public static void main(String args[]) {
int side1 = Integer.parseInt(JOptionPane.showInputDialog("Enter the first side"));
int side2 = Integer.parseInt(JOptionPane.showInputDialog("Enter the second side"));
int side3 = Integer.parseInt(JOptionPane.showInputDialog("Enter the third side"));
if (side1 == side2 && side2 == side3){
JOptionPane.showMessageDialog(null,"It is an equilateral triangle");
}else{
if (side1 == side2 || side2 == side3) {
JOptionPane.showMessageDialog(null,"It is an isosceles triagle")
}else{
JOptionPane.showMessageDialog(null,"It is an scalene triagle")
}
}
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new JTextField_JFrame().setVisible(true);
}
});
}