Home arrow static arrow Java Programming [Archive] - To All You Girls Out There
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - To All You Girls Out There
This topic has 31 replies on 3 pages.    1 | 2 | 3 | Next »

Posts:131
Registered: 9/9/03
To All You Girls Out There  
Jun 24, 2004 8:03 PM



 
Would any of you girls (if your name were Carlene) be impressed by this program? Compile and run it. You'll have to make the window larger when it first starts up, though. (BTW, I am Jared.)

import java.awt.*;import java.awt.event.*;import javax.swing.*; public class Carlene implements ActionListener{  JLabel label = new JLabel();  int numClicks = 0;  public Component createComponents()  {    JPanel panel = new JPanel();    JButton button = new JButton("Find out who Jared likes!");     button.addActionListener(this);     panel.add(button);    panel.add(label);     return panel;  }  public static void createAndShowGUI()  {    JFrame frame = new JFrame("Jared's Crush");     Carlene carlene = new Carlene();    Component components = carlene.createComponents();     frame.getContentPane().add(components, BorderLayout.CENTER);    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);    frame.pack();    frame.setVisible(true);  }  public void actionPerformed(ActionEvent e)  {    numClicks++;    switch(numClicks)    {      case 1: label.setText("C------"); break;      case 2: label.setText("Ca-----"); break;      case 3: label.setText("Car----"); break;      case 4: label.setText("Carl---"); break;      case 5: label.setText("Carle--"); break;      case 6: label.setText("Carlen-"); break;      case 7: label.setText("Carlene"); break;    }  }  public static void main(String[] args)  {    javax.swing.SwingUtilities.invokeLater(new Runnable()    {      public void run()      {        createAndShowGUI();      }    });  }}
 

Posts:1,657
Registered: 1/8/98
Re: To All You Girls Out There  
Jun 24, 2004 8:19 PM (reply 1 of 31)



 
You have got to be kidding me...
 

Posts:9,091
Registered: 8/15/01
Re: To All You Girls Out There  
Jun 24, 2004 8:23 PM (reply 2 of 31)



 
Me thinks someone needs to get out more.
 

Posts:7,258
Registered: 1/31/02
Re: To All You Girls Out There  
Jun 24, 2004 8:27 PM (reply 3 of 31)



 
Hey Ace - check out the setSize(int, int) method your JFrame gets from Component - that way you don't have to tell Carlene to make the window larger.

Ah - the things we do for love...

Good Luck

Lee

 

Posts:62
Registered: 5/11/04
Re: To All You Girls Out There  
Jun 24, 2004 8:42 PM (reply 4 of 31)



 
Haha, nice. I have made a few programs for my girlfriend as well. Just make sure she can open it easily (I would suggest putting it in a runnable jar).
 

Posts:56
Registered: 18/06/03
Re: To All You Girls Out There  
Jun 25, 2004 12:13 AM (reply 5 of 31)



 
I don't think I would be very impressed (as both my boyfriend and I do quite a bit of Java programming), but I would find it really charming and cute. Before I learned anything about programming, however, I would definitely have been impressed.

If my boyfriend made something like that for me, he'd probably get some kind of a reward... (nuff said;)

-negala
 

Posts:9,091
Registered: 8/15/01
Re: To All You Girls Out There  
Jun 25, 2004 12:29 AM (reply 6 of 31)



 
If I made something like this for my g/f I'd get spanked for spending to much time on the computer, then dragged down to Hyde Park to get away from The Evil.
 

Posts:89
Registered: 04-06-04
Re: To All You Girls Out There  
Jun 25, 2004 5:57 AM (reply 7 of 31)



 
Stick with jewelry - it will get you farther in the long run.

Not criticism of your code - just a suggestion. ;)

∞ brewman ∞
 

Posts:8,813
Registered: 10/4/00
Re: To All You Girls Out There  
Jun 25, 2004 6:06 AM (reply 8 of 31)



 
You might think about a career as a singing gynecologist...

♫ ♫ To all the girls I've gloved before... ♫♫

Good Afternoon, Dr. JDCAce at your cervix...
 

Posts:8,813
Registered: 10/4/00
Re: To All You Girls Out There  
Jun 25, 2004 6:09 AM (reply 9 of 31)



 
Wow, I can hear all your brain cells dying out there...
 

Posts:5,627
Registered: 3/22/04
Re: To All You Girls Out There  
Jun 25, 2004 6:34 AM (reply 10 of 31)



 
If I made something like this for my g/f I'd get
spanked for spending to much time on the computer,
then dragged down to Hyde Park to get away from The
Evil.

Drowning in Serpentine?
 

Posts:5,627
Registered: 3/22/04
Re: To All You Girls Out There  
Jun 25, 2004 6:35 AM (reply 11 of 31)



 
You might think about a career as a singing
gynecologist...

♫ ♫ To all the girls I've gloved
before... ♫♫

Good Afternoon, Dr. JDCAce at your cervix...

I have a couple of medical jokes but if I post 'em, I'd think they'de be lost on people, esp. as one is visual.

****.
 

Posts:50
Registered: 12/9/97
Give this girl a break!  
Jun 25, 2004 7:49 AM (reply 12 of 31)



 
I was impressed by a program that split and load-balanced a povray rendering job across 60 Sparc machines once to cut a 6-7 hour job down to less than 20 minutes. I was also impressed by another program that monitored sub-atomic particles emitted during chemical reactions.

Neither was Java, and neither of these impressive programs helped the guy get me in the end, mind you
(I somehow ended up with a VB programmer?!?)

--alexx
 

Posts:10,972
Registered: 10/23/03
Re: Give this girl a break!  
Jun 25, 2004 7:52 AM (reply 13 of 31)



 
(I somehow ended up with a VB programmer?!?)

That's the kind of comment that make Java programmers cry into their Jolt Colas.
 

Posts:50
Registered: 12/9/97
Re: Give this girl a break!  
Jun 25, 2004 7:55 AM (reply 14 of 31)



 
It makes for interesting dinnertime conversations that's for sure ;-)
 
This topic has 31 replies on 3 pages.    1 | 2 | 3 | Next »