C.R.A.C.K.E.R. Fest Gaming Network Forums
It is currently Sun Dec 22, 2024 3:24 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Jimmy... look at this
PostPosted: Thu Jan 27, 2005 12:28 pm 
Offline
Ninja King
Ninja King
User avatar

Posts: 419
Location: Statesboro, GA
Joined: Mon Sep 20, 2004 9:06 pm
Hey Jimmy... Post the meat of that program... I'ma tweak with it a little bit...

_________________
http://www.crystalinks.com/bigbang2.jpg

"Sporks are outdated"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 27, 2005 12:52 pm 
Offline
Rev. of Gnomeforest Baptist
Rev. of Gnomeforest Baptist
User avatar

Posts: 832
Location: The Forest of Gnomes
Joined: Thu Mar 25, 2004 8:04 pm
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;
}
}

_________________
I put on my robe and wizard hat.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 27, 2005 1:29 pm 
Offline
Kikkoman
Kikkoman
User avatar

Posts: 2391
Location: 127.0.0.1
Joined: Fri Mar 19, 2004 3:51 pm
You copy.

_________________



Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 949 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron