This java swing example explain you how to remove title bar from the frame. Here is the example code :
import javax.swing.*;
public class RemoveTitleFrame{
public static void main(String[] args) {
JFrame frame = new JFrame(Frame With No Title Bar);
frame.setUndecorated(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400,400);
frame.setVisible(true);
}
}
Friday, February 22, 2008
Monday, February 18, 2008
Java : List Prime Numbers between 1 to Given Number
import java.io.*;
class AllEvenNum{
public static void main(String[] args) {
try{
BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a Number : ");
int num = Integer.parseInt(br1.readLine());
System.out.println("Even Numbers are:");
for (int i=1;i <=num ; i++){
if(i%2==0 ){
System.out.print(i+",");
}
}
}
catch(Exception e){}
}
}
Subscribe to:
Posts (Atom)