C.R.A.C.K.E.R. Fest Gaming Network Forums http://forums.crackerfest.com/ |
|
Jimmy... look at this http://forums.crackerfest.com/viewtopic.php?f=1&t=456 |
Page 1 of 1 |
Author: | SPEED [ Thu Jan 27, 2005 12:28 pm ] |
Post subject: | Jimmy... look at this |
Hey Jimmy... Post the meat of that program... I'ma tweak with it a little bit... |
Author: | Kraka_Da_LAN [ Thu Jan 27, 2005 12:52 pm ] |
Post subject: | |
Chapter 10 - Exercise 2 Program //Jimmy Lee //Chapter 10 - Exercise 2 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class JBlueGray extends JApplet implements ActionListener { String name = "Jimmy Lee"; JButton button = new JButton("Click Me"); JPanel pane = new JPanel(); Font font = new Font("Helvetica",Font.PLAIN,12); public void init() { Graphics g = getGraphics(); pane.add(button); button.addActionListener(this); pane.setBackground(Color.green); setContentPane(pane); setVisible(true); button.setVisible(true); } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if(source == button) { repaint(); } } public void paint(Graphics g) { int num = 0; g.setFont(font); g.setColor(Color.black); g.drawString("Jimmy Lee",250,100); if(num == 1) { g.setFont(font); g.setColor(Color.blue); g.drawString("Jimmy Lee",250,100) ++num; }else{ font = new Font("Helvetica",Font.PLAIN,36); g.setColor(Color.gray); g.drawString("Jimmy Lee",250,100); } ++num; } } |
Author: | Yeorwned [ Thu Jan 27, 2005 1:29 pm ] |
Post subject: | |
You copy. |
Page 1 of 1 | All times are UTC - 5 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |