24 Replies - 615 Views - Last Post: 03 August 2012 - 09:54 AM
#16
Re: Passing text from JFrame
Posted 03 August 2012 - 08:03 AM
#17
Re: Passing text from JFrame
Posted 03 August 2012 - 08:08 AM
Our instructor has us use the show() method, but I will switch it, it bugs me to use older methods. He also makes us use String Tokenizer to parse Strings lol.
I thought I had to create instances at the top, I will change that and give it a try.
EDIT: It's running BRILLIANTLY! I can't thank you 2 enough, I have spent a LOT of hours on this and it's wonderful to see it running as it should!!
Now.. off to add more functionality and write a user manual. Hopefully today won't be another 14 hour day.
GregBrannon, on 03 August 2012 - 09:52 AM, said:
I can make a 30-minute call, view the bill, and it's $6.00. I make another 30-minute call, view the bill, and it goes to $12.00. Seems to work fine.
I did notice that the bill window shows up before it should showing a blank total bill, behind the JavaPhone's first menu before there have been any calls, so that needs to be fixed. Close that and proceed as I mentioned above, and that part seems okay.
Let me know what you need help with.
Edit: The reason you're getting an empty BillWindow is because you create the instance of windowBill in your JavaPhone instance variable declarations (lines 21 - 23). Do you need those instances created there?
If you modify the instance variables at the top to:
SmartPhone myPhone; // = new SmartPhone();
InputWindow windowIn; // = new InputWindow("");
BillWindow windowBill; // = new BillWindow("");
And then create an instance of myPhone in the JavaPhone constructor:
myPhone = new SmartPhone();
before making it visible, you should be fine.
By the way, JFrame.show() is deprecated. Use JFrame.setVisible( true );
This post has been edited by synlight: 03 August 2012 - 08:13 AM
#18
Re: Passing text from JFrame
Posted 03 August 2012 - 08:14 AM
#19
Re: Passing text from JFrame
Posted 03 August 2012 - 08:15 AM
Quote
Erase that thought from your mind. Replace it with "Never create instances at the top." There may be rare exceptions, but I can't think of any. If you encounter one of those rare instances, use an initialization block and explain what you're doing and why to make it clear. Other than an initialization block, creating instances of the instance variables is what the constructor and/or other appropriate methods are for.
#20
Re: Passing text from JFrame
Posted 03 August 2012 - 08:23 AM
CasiOo, on 03 August 2012 - 10:14 AM, said:
Omgosh! I'm on my cellphone, and tried to give you plus 1, and I accidentally hit the minus 1 button! I'm so sorry!
When I gey back to my computer I will try to fix it :c
#21
Re: Passing text from JFrame
Posted 03 August 2012 - 08:27 AM
synlight, on 03 August 2012 - 03:23 PM, said:
CasiOo, on 03 August 2012 - 10:14 AM, said:
Omgosh! I'm on my cellphone, and tried to give you plus 1, and I accidentally hit the minus 1 button! I'm so sorry!
When I gey back to my computer I will try to fix it :c
=< haha
#22
Re: Passing text from JFrame
Posted 03 August 2012 - 08:35 AM
Quote
I guess I should be glad I got nothing.
#23
Re: Passing text from JFrame
Posted 03 August 2012 - 08:38 AM
I'm still on my phone, and haven't found a way to fix it yet. I'll email the mods if I have to.
GregBrannon, on 03 August 2012 - 10:35 AM, said:
Quote
I guess I should be glad I got nothing.
#24
Re: Passing text from JFrame
Posted 03 August 2012 - 09:43 AM
CasiOo, on 03 August 2012 - 10:14 AM, said:
Mac upvoted you to counteract the downvote, but there's nothing they can do about removing my downvote.
I'm realllllly sorry CasiOo.. no more rep on my cell phone.
#25
Re: Passing text from JFrame
Posted 03 August 2012 - 09:54 AM
|
|

New Topic/Question
Reply




MultiQuote



|