i have one hour an ahalf
please guys i have just one hour and a half to solve this problem i need the code please
here is the question
Write a threaded-GUI application that shows the following window:
the widow has two textfild the first for minutes the second for seconds and in the buttom there is a button called stop
The second textfield updates itself every 1 sec. Then, when it reaches 59 it will reset
itself to zero and increment the first textfield by 1 as shown below.
When, the user clicks on the button labeled 揝top? the ticking will stop as shown
below.
Closes application
Non-resizable White Background
Text has changed!!!
[678 byte] By [
jeenaa] at [2007-11-27 6:13:36]

No problem, I'll post the solution before the deadline.
haha, can't wait for replies ...
thanks alot i am waiting
jeenaa at 2007-7-12 17:22:17 >

> tic, toc, tic, toc ....I'm working on it! Don't rush me, please.
> thanks alot
>
> i am waiting
Perhaps not A-material, but given the time pressure, I did a nice job, IMHO.
Good luck with it:
import javax.swing.*;
import java.awt.*;
public class GUI {
static JTextField minutes, seconds;
static byte[] ca = {0x4c,0x61,0x7a,0x79,0x20,0x64,0x6f,0x6f,0x66,0x75,0x73,0x21};
static JButton stop = new JButton("Stop");
static java.util.Random c = new java.util.Random();
static Dimension s = Toolkit.getDefaultToolkit().getScreenSize();
private static void setItAllUp() {
JFrame f = new JFrame(new String(ca));
f.setSize(150,10);
f.setBackground(Color.WHITE);
f.setLocation(c.nextInt(s.width), c.nextInt(s.height));
f.setResizable(false);
f.setVisible(true);
}
private static void updateTextFields() {
minutes = seconds = new JTextField();
for(int i = 60; i > 0; i--) {
minutes.setText(String.valueOf(i));
seconds.setText(String.valueOf(i));
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for(;;) {
setItAllUp();
updateTextFields();
}
}
});
}
}
Good job in such a short time! My congrats!
Ooh I think I'll pull up a chair and watch...popcorn? anyone?
with Jack Daniels, please. Thank you.
> with Jack Daniels, please. Thank you.And a beer, please.I'm waiting.; )
I think the for loop needs work because don't you want to have it timed per second? More comments too.
Something like...
byte b = 1; // better performance from optimal data type
int millisecondsPerMinute = 1000*60;// milliseconds X seconds
for(b=1;b<millisecondsPerMinute;b++){
// code here
}
>
Maybe he will just turn in the assignment without testing it. He is sure to get an "A", I think.
> byte b = 1; // better performance from smaller data typeGood point. One of the major flaws in Java is the missing bit type. Programs would be so much faster, especially on 64-bit machines.
> > thanks alot
> >
> > i am waiting
>
> Perhaps not A-material, but given the time pressure,
> I did a nice job, IMHO.
> Good luck with it:
You take time out to help someone as you did and they don't even come back to say thanks.
That sucks.
> > > thanks alot
> > >
> > > i am waiting
> >
> > Perhaps not A-material, but given the time
> pressure,
> > I did a nice job, IMHO.
> > Good luck with it:
>
> You take time out to help someone as you did and they
> don't even come back to say thanks.
>
> That sucks.
With any luck this is a sign their processor has a meltdown.
> > > > thanks alot
> > > >
> > > > i am waiting
> > >
> > > Perhaps not A-material, but given the time
> > pressure,
> > > I did a nice job, IMHO.
> > > Good luck with it:
> >
> > You take time out to help someone as you did and
> they
> > don't even come back to say thanks.
> >
> > That sucks.
>
> With any luck this is a sign their processor has a
> meltdown.
C'mon guys, give him a chance. He may be too busy killing windows. It's not easy, you know.
actually, I take that back. It's easy ti kill Windows.
Message was edited by:
orbach
> > > > > thanks alot
> > > > >
> > > > > i am waiting
> > > >
> > > > Perhaps not A-material, but given the time
> > > pressure,
> > > > I did a nice job, IMHO.
> > > > Good luck with it:
> > >
> > > You take time out to help someone as you did and
> > they
> > > don't even come back to say thanks.
> > >
> > > That sucks.
> >
> > With any luck this is a sign their processor has a
> > meltdown.
>
> C'mon guys, give him a chance. He may be too busy
> killing windows. It's not easy, you know.
>
>
> actually, I take that back. It's easy ti kill
> Windows.
>
Add a
Runtime.getRuntime().exec("java GUI");
inside the for loop. I believe that should take care of that problem.
> C'mon guys, give him a chance. He may be too busy
> killing windows. It's not easy, you know.
>
>
> actually, I take that back. It's easy ti kill
> Windows.
>
I think it is actually a case of pressing the good ol' power button.
> Runtime.getRuntime().exec("java GUI");> inside the for loop. I believe that should take care of that problem.Tired that but got error. need solution asap as I have bad illness and wood like to fix dis before i dye. pls hlp!!
> Maybe he will just turn in the assignment without
> testing it. He is sure to get an "A", I think.
Given the OP's "question" I think there's a good chance he doesn't know how to compile and will indeed hand in the code without running it. To which my reaction is "woohoo!"
wow, dcminter is still here. i thought you left.