HomeHome  PortalPortal  CalendarCalendar  GalleryGallery  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 java program

View previous topic View next topic Go down 
AuthorMessage
GiEx D'HCKR
Newbie
Newbie


Jumlah posting : 15 Age : 25
Lokasi : unib

PostSubject: java program    Thu Dec 16, 2010 8:29 pm

cuma sebagai referensi sript jva dengan netbeans:
jika ada kesalahan mohon dimaafkan






import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class ClickMe2 extends JFrame {

private JButton tombol, btnExit;

public ClickMe2() {

super ("Event Handling");

Container container = getContentPane();

container.setLayout(new FlowLayout());

ClickListener cl = new ClickListener ();

tombol = new JButton ("Click Me!");

tombol.addActionListener(cl);

container.add(tombol);

btnExit = new JButton ("Exit");

btnExit.addActionListener(cl);

container.add(btnExit);

setSize (200,100);

setVisible (true);

}

public static void main (String arg[]) {

ClickMe2 test = new ClickMe2();

test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

//inner class

private class ClickListener implements ActionListener {

public void actionPerformed (ActionEvent e) {

if (e.getSource() == tombol) {

JOptionPane.showMessageDialog(null, "You click me again, guys !!!");

} else if (e.getSource() == btnExit){

JOptionPane.showMessageDialog(null, "See you, guys !");

System.exit(0);

}

}

}

}
:ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: :ketawa1: [center]
Back to top Go down
View user profile
 
java program
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Ninja pak ketu N250R East Java Community
» bikin blog hemat energi!
» N250R Academy - Cyberist Paris Van Java (BDG)
» Touring N250R East Java Community to Jogja 8 - 10 mei 2009
» Parkiran mall Bandung..

Permissions in this forum:You cannot reply to topics in this forum
 :: Kampus HIMATIF UNIB :: Software And Programming Room-
Jump to: