Posts

Showing posts from 2015

JDatePicker In Java

Image
Hi. Friends . This is a Library named "JDatePicker" created by me, through which you can use pick desired Date. How to use.. Step 1- Download "DatePick.jar file" from this blog. Step 2- Follow the following Steps Step 3- Choose Tools>>Palette>>Swing/AWT Component  Step 4-  Select the Downloaded "DatePick.jar" file by clicking "Add from JAR" option   Step- 5  Choose JDatePicker Component Step-6   Select Palette Category to add Component and click on finish. Step-7  Select JDatePicker from Swing Controls and draw in a Container (JFrame,JDialog,JPanel, etc.) OUTPUT : Thank you.. Please Download it. from following link. DatePick.jar (JDatePicker)

Setting Background image of JFrame containg Components

Image
Step 1- Save the following source code in a file named "LoginPanel.java" import java.awt.*; import javax.swing.*; class BgPanel extends JPanel {     Image bg = new ImageIcon("Back.jpg").getImage();     public void paintComponent(Graphics g) {         g.drawImage(bg, 0, 0, getWidth(), getHeight(), this);     }   BgPanel()   {        JLabel l1=new JLabel("Username: ");        JLabel l2=new JLabel("Password: ");        JTextField t1=new JTextField(15);        JTextField t2=new JTextField(15);        JButton b1=new JButton("Login");        JButton b2=new JButton("Cancel");        l1.setBounds(20,40,90,25);        l2.setBounds(20,70,90,25);        t1.setBounds(120,40,170,25);        t2.setBounds(120,70,170,25); ...

Java Frame with Fading Effect

Image
import java.util.Timer; import java.util.TimerTask; import javax.swing.*; import java.awt.*; public class FadeDemo extends JFrame {    JFrame frm=null;    JLabel l1=new JLabel("Look at Frame, Its Fading",JLabel.CENTER);    float s=1.0f;    boolean flag=true;    FadeDemo()    {   frm=this;        frm.setUndecorated(true);        frm.getContentPane().setBackground(Color.orange);            l1.setFont(new Font("Times new roman",Font.BOLD,12));        add(l1,BorderLayout.CENTER);        setBounds(100,50,450,550);        setVisible(true);        Timer timer = new Timer();        timer.schedule(new TimerTask()           {   public void run()                {   ...