Posts

Bouncing Ball Program in Swing | Java.

Image
Hello Guys! Here We are going to learn that How to make a Bouncing Ball program in Swing. it is very is to  implement for you because the code of Bouncing Ball is written in easy way and it is given below :- File Name :- BouncingBall.java import java.awt.*; import java.util.Formatter; import javax.swing.*; // Extends JPanel, so as to override the paintComponent() for custom rendering codes. public class BouncingBall extends JPanel {    // Container box's width and height    private static final int BOX_WIDTH = 800;    private static final int BOX_HEIGHT = 500;      // Ball's properties    private float ballRadius = 100;            // Ball's radius    private float ballX = ballRadius + 50;     // Ball's center (x, y)    private float ballY = ballRadius + 20;     private float ballSpeedX = 3;              // Ball's speed for x and y    private float ballSpeedY = 2;      private static final int UPDATE_RATE = 30; // Number of refresh per second

Creation of Home Page in Swing | Java | Go & See.

Image
Hello Guys! Here , We are going to learn How to make a Home Page of Desktop application in Swing. and The Code is given below and it is very easy to see & understandable. File Name :- Home.java import javax.swing.*; import java.awt.*; public class Home { private JFrame f; private FlowLayout flow; private JMenuBar mb; private JMenu m1; private JMenu m2; private JMenu m3; private JMenu m4; private JMenu m5; private JMenuItem mi1; private JMenuItem mi2; private JMenuItem mi3; private JMenuItem mi4; private JMenuItem mi5; private JMenuItem mi6; private JMenuItem mi7; private JMenuItem mi8; public Home() { Initial(); } private  void Initial() { f=new JFrame("Home Page");     flow=new FlowLayout();     mb =new JMenuBar();     m1 =new JMenu("Home");     m2 =new JMenu("Patient");     m3 =new JMenu("Doctor");     m4 =new JMenu("Edit Record");     m5

Login Page in Swing with Database connectivity.

Image
Hello Guys! Here , The code of Login Page are written in Swing. Which is given Below :- But before using this code you create a Database " Student "  and   Table " login ". after then you create two columns in login table.                                                                                      1. Username                                                                                     2. Password Then  use this code and compile & run your program. File Name :- Login.java import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; public class Login implements ActionListener  { private JFrame f; private JPanel panel; private JLabel l1;     private JLabel l2; private JTextField tf1; private JTextField tf2; private JButton b1; private JButton b2; private JLabel l3; public Login() { loginFrame(); } public void actionPerformed(ActionEvent ae) { tf1.setText(" ");

Layout Design of Calculator in Java.

Image
Hello Guys! Here , We learn How to design " layout of Calculator "  in java. The Layout Design code is written in  AWT (Abstract Window Toolkit). and Code is given below -:  File Name :-   CalculatorDesign.java import java.awt.*; import java.awt.event.*; class CalculatorDesign {   public static void main(String args[])    {      Frame f=new Frame("Calculator");      f.setTitle("My Calculator Layout");      TextField tf=new TextField(20);      Panel p1=new Panel();      GridLayout gl=new GridLayout(6,6,8,8);      Button bb2=new Button("Designed By ANIL SHARMA");      Button b0=new Button(" 0 ");      Button b1=new Button(" 1 ");      Button b2=new Button(" 2 ");      Button b3=new Button(" 3 ");      Button b4=new Button(" 4 ");      Button b5=new Button(" 5 ");      Button b6=new Button(" 6 ");      Button b7=new Button(" 7 ");      Button b