Java Swing


Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Core Java

Open Dialog box

import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; public class OpenMenu extends JFrame implements ActionListener{ JMenuBar mb; JMenu file; JMenuItem open; JTextArea ta; OpenMenu(){ open=new JMenuItem(“Open File”); open.addActionListener(this); file=new JMenu(“File”); file.add(open); mb=new JMenuBar(); mb.setBounds(0,0,800,20); mb.add(file); ta=new JTextArea(800,800); ta.setBounds(0,20,800,800); add(mb); add(ta); } public void actionPerformed(ActionEvent e) { if(e.getSource()==open){ openFile();…

Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Core Java

Edit menu for Notepad

import javax.swing.*; import java.awt.event.*; public class Notepad implements ActionListener{ JFrame f; JMenuBar mb; JMenu file,edit,help; JMenuItem cut,copy,paste,selectAll; JTextArea ta; Notepad(){ f=new JFrame(); cut=new JMenuItem(“cut”); copy=new JMenuItem(“copy”); paste=new JMenuItem(“paste”); selectAll=new JMenuItem(“selectAll”); cut.addActionListener(this); copy.addActionListener(this); paste.addActionListener(this); selectAll.addActionListener(this); mb=new JMenuBar(); mb.setBounds(5,5,400,40); file=new JMenu(“File”); edit=new JMenu(“Edit”); help=new JMenu(“Help”); edit.add(cut);edit.add(copy);edit.add(paste);edit.add(selectAll); mb.add(file);mb.add(edit);mb.add(help);…

Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Core Java

Digital Watch

import javax.swing.*; import java.awt.*; import java.text.*; import java.util.*; public class DigitalWatch implements Runnable{ JFrame f; Thread t=null; int hours=0, minutes=0, seconds=0; String timeString = “”; JButton b; DigitalWatch(){     f=new JFrame();     t = new Thread(this);         t.start();     b=new JButton();         b.setBounds(100,100,100,50);     f.add(b);     f.setSize(300,400);     f.setLayout(null);     f.setVisible(true); }  public void run() {       try {          while (true) {             Calendar cal = Calendar.getInstance();…

Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages
Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages