Why won't GUI display correctly ? --URGENT--

Hi,

I am copying the code from my book. For some reason the color doesn't work when I copy+paste teh code into Eclipse. Am I doing something wrong or do I have to enable something in Eclipse options? I keep getting 2 windows WITH NO TXT and NO COLOR.Here is the code:

import javax.swing.*;

import java.awt.*;//needed for the Color class

publicclass SecondWindowextends JFrame

{

publicstaticfinalint WIDTH = 200;

publicstaticfinalint HEIGHT = 200;

public SecondWindow( )

{

super( );

setSize(WIDTH, HEIGHT);

Container contentPane = getContentPane( );

JLabel label =new JLabel("Now available in color!");

contentPane.add(label);

setTitle("Second Window");

contentPane.setBackground(Color.BLUE);

addWindowListener(new WindowDestroyer( ));

}

public SecondWindow(Color customColor)

{

super( );

setSize(WIDTH, HEIGHT);

Container contentPane = getContentPane( );

JLabel label =new JLabel("Now available in color!");

contentPane.add(label);

setTitle("Second Window");

contentPane.setBackground(customColor);

addWindowListener(new WindowDestroyer( ));

}

}

and the driver file

import java.awt.*;//for the class Color used in an argument.

publicclass SecondWindowDemo

{

/**

Creates and displays two windows of the class SecondWindow.

*/

publicstaticvoid main(String[] args)

{

SecondWindow window1 =new SecondWindow( );

window1.setVisible(true);

SecondWindow window2 =new SecondWindow(Color.PINK);

window2.setVisible(true);

}

}

WINDOWS Destroyer Class

import java.awt.*;

import java.awt.event.*;

/**

If you register an object of this class as a listener to any

object of the class JFrame, then if the user clicks the

close-window button in the JFrame, the object of this class

will end the program and close the JFrame.

*/

publicclass WindowDestroyerextends WindowAdapter

{

publicvoid windowClosing(WindowEvent e)

{

System.exit(0);

}

}

Message was edited by:

eristic

Message was edited by:

eristic

[4150 byte] By [eristica] at [2007-11-27 8:49:03]
# 1
Because you marked this thread as --URGENT-- I will not give you an answer for 24 hours.In future do not describe you threads as URGENT.
cotton.ma at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 2
I am doing a presentation in 4 hours... that's kind of urgent. So, you withhold information just because I need it soon?That's kind of messed up.
eristica at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 3
> I am doing a presentation in 4 hours... that's kind> of urgent. Oh well. That's your poor time management problem. Not mine.Consider it a learning experience.
cotton.ma at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 4

I'm not sure if you are having a bad day, but this is a forum that is supposed to be used to help people. If you weren't going to help, then why bother even posting? Just to come around and yell at me and take out your anger and flaunt your knowledge? There aren't any forum rules posted in this forum saying that it's wrong to post a title as URGENT. Geez, look at my post count and give me some slack.

eristica at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 5

> I'm not sure if you are having a bad day, but this is

> a forum that is supposed to be used to help people.

I am helping you. I am helping you learn proper forum ettiquette and time management skills.

> If you weren't going to help, then why bother even

> posting?

I will help you with your code problem tomorrow.

>Just to come around and yell at me

I didn't yell at you.

cotton.ma at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 6
Well I read the forum rules and it doesn't say anything about not using URGENT. Sounds like you are going based on convention.
eristica at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 7
I think code is ok It wiil give Correct result as u want.How u run that code ?
OnlyForJavaa at 2007-7-12 20:57:28 > top of Java-index,Java Essentials,New To Java...
# 8

I put it in eclipse and ran it. None of the colors work, its just 2 windows that are gray. I copied the code straight out of the book. I don't know why it doesn't work.

SEE: [IMG]http://i18.tinypic.com/5xepi0p.png[/IMG]

Message was edited by:

eristic

Message was edited by:

eristic

eristica at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 9
I was about to help, but when I read "urgent" I guessed I'm too late anyway. Sorry.
CeciNEstPasUnProgrammeura at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 10

Oh, something you might be interested in to read while you're working on your next project:

http://www.catb.org/~esr/faqs/smart-questions.html#urgent

It's not "forum rules", just as there's no rule that we have to help here, either. But I'm sure you might have heard about things called "politeness" and "common sense".

CeciNEstPasUnProgrammeura at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 11

> Well I read the forum rules and it doesn't say

> anything about not using URGENT. Sounds like you are

> going based on convention.

Consider basic good manners. You have just approached a bunch of strangers and asked them for their help, for free. By telling us it's urgent, you're really saying "my problem is more important than these other people asking for help", which is only true as far as you're concerned. Everyone considers their own problem more important.

The forum rules may not say anything about not using "URGENT", but since the people answering the questions have the power to do so or not, you just have to abide by what they say. Like it or lump it, basically. Or cough up some hard currency

georgemca at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 12
> SEE: [IMG] http://i18.tinypic.com/5xepi0p.png[/IMG]> Ohh, eclipse looks kind of nice in ubuntu... That is ubuntu right?
macrules2a at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 13

> Well I read the forum rules and it doesn't say

> anything about not using URGENT. Sounds like you are

> going based on convention.

Common sense should tell you that it's arrogant and annoying to tell people that your problem should be more important to them than others' problems, and that that's exactly what you're doing when you yell, "URGENT".

I also make it a point not to answer such threads except to tell the person how counterproductive it is.

jverda at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 14
> > SEE:> [IMG] http://i18.tinypic.com/5xepi0p.png[/IMG]> > > Ohh, eclipse looks kind of nice in ubuntu... That is> ubuntu right?Ya, its ubuntu. I like Eclipse on it better than anything else.
eristica at 2007-7-12 20:57:29 > top of Java-index,Java Essentials,New To Java...
# 15

> > Well I read the forum rules and it doesn't say

> > anything about not using URGENT. Sounds like you

> are

> > going based on convention.

>

> Common sense should tell you that it's arrogant and

> annoying to tell people that your problem should be

> more important to them than others' problems, and

> that that's exactly what you're doing when you yell,

> "URGENT".

>

> I also make it a point not to answer such threads

> except to tell the person how counterproductive it is.

I never said it was more important than anyone elses. I just wanted to stress the time sensitivity of it.

eristica at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 16

> I never said it was more important than anyone elses.

Yes, you did. When you said, "urgent."

> I just wanted to stress the time sensitivity of it.

I promise you, nobody here cares about that. People answer questions in their own time for their own reasons, but others' time pressures do not figure into those reasons--except to the extent that hearing about them pushes that post to the bottom of the heap.

jverda at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 17

> > > Well I read the forum rules and it doesn't say

> > > anything about not using URGENT. Sounds like

> you

> > are

> > > going based on convention.

> >

> > Common sense should tell you that it's arrogant

> and

> > annoying to tell people that your problem should

> be

> > more important to them than others' problems, and

> > that that's exactly what you're doing when you

> yell,

> > "URGENT".

> >

> > I also make it a point not to answer such threads

> > except to tell the person how counterproductive it

> is.

>

>

>

> I never said it was more important than anyone elses.

> I just wanted to stress the time sensitivity of it.

Look, you're making things worse for yourself. It is forum etiquette not to mark your post as URGENT, simple as that. No amount of arguing about it is going to change that, just accept you got it wrong and move on, nobody is in the business of holding grudges here, but arguing with the very people you're asking for help? Surely you can see the folly in that!

georgemca at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 18

I was just trying to explain the reasoning for it. It's not like every post I've ever made has said urgent. This is the only one. I can't even explain why I did it without being flamed. If this were at least posted in a sticky or something I would have no excuse.

And that thing the guy linked was talking about hackers. I'm not a hacker or spammer. Just trying to figure out why it won't load the gui right when I'm copying the code straight out of the book.

Message was edited by:

eristic

eristica at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 19

> I was just trying to explain the reasoning for it.

> It's not like every post I've ever made has said

> urgent. This is the only one. I can't even explain

> why I did it without being flamed. If this were at

> least posted in a sticky or something I would have

> no excuse.

There is no reasoning. It's only urgent to you. Don't take it personally, everyone who marks it "URGENT" gets the same treatment. Your best bet - in fact the only approach that will work - is to apologise and get on with it. Arguing your case just makes you look like a truculent teenager

> And that thing the guy linked was talking about

> hackers. I'm not a hacker or spammer. Just trying

> to figure out why it won't load the gui right when

> I'm copying the code straight out of the book.

>

The link is all about how to behave in a technical forum. Implicitly, it's the members of the forum that are the hackers

georgemca at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 20

> I was just trying to explain the reasoning for it.

> It's not like every post I've ever made has said

> urgent. This is the only one. I can't even explain

> why I did it without being flamed. ...

You're being flamed because there is no valid reason. All of the people answering here are volunteers who do not know you. Expecting unknown volunteers to answer YOUR post asap, is rude behaviour. And besides, what makes you think your question is more urgent than other people's questions?

No matter how much you explain why it is urgent to you, most people who answer here despise such urgent-tags, so there's really no point in arguing. It'll only make it worse, believe me.

prometheuzza at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 21

Yes, we understand why you did it--because it's urgent to you. That's not the point though. The point is that we're informing you that we find hearing about that urgency annoying and don't wish to answer questions like that.

You can rail all you want about why you did it and about how the forum rules don't forbid it, but the fact is that they also don't forbid people ignoring posts that have the word urgent in them.

Would it have been better if nobody informed you, and instead just ignored your question without telling you why?

jverda at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 22
Not to mention, of course, that since you've got 4 (less, now) hours to get this done, you're wasting time on a flamewar when you could just apologise and get some help. It is urgent, after all
georgemca at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 23

> Not to mention, of course, that since you've got 4

> (less, now) hours to get this done, you're wasting

> time on a flamewar when you could just apologise and

> get some help. It is urgent, after all

I always have to shake my head and chuckle at how all these "urgent" problems suddenly become less urgent than arguing about why it was okay to mark it as urgent. :-)

jverda at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 24

If its that big of a deal then people shouldn't have attacked me. It could have been said to me that its an unofficial rule that everyone here goes by and thats that. Not coming off as nose up in the air and too good to answer becuase I did something that no one likes and no one informed about the "rule." Basically, people didn't have to be rude to let me know the problem. Anyone could have checked my posts and saw that this was my first time doing this.

As for people ignoring, I think that sooner or later someone would answered. Everyone gives and takes on a forum. That's the idea behind it. When I learn more I'll try to help people as well. I didn't think putting the urgency would cause such a problem.

eristica at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 25

> If its that big of a deal then people shouldn't have

> attacked me. It could have been said to me that its

> an unofficial rule that everyone here goes by and

> thats that. Not coming off as nose up in the air and

> too good to answer becuase I did something that no

> one likes and no one informed about the "rule."

> Basically, people didn't have to be rude to let me

> know the problem. Anyone could have checked my

> posts and saw that this was my first time doing

> this.

>

> As for people ignoring, I think that sooner or later

> someone would answered. Everyone gives and takes on

> a forum. That's the idea behind it. When I learn

> more I'll try to help people as well. I didn't think

> putting the urgency would cause such a problem.

Yeh yeh yeh, poor you. You've had ample opportunity to move on from this, and not bothered. No help at all for you then. Bye bye. If I was you, I'd sign up again with a different name, I for one won't even bother reading your posts from now on

georgemca at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 26

> If its that big of a deal then people shouldn't have

> attacked me.

Where were you attacked?

> It could have been said to me that its

> an unofficial rule that everyone here goes by and

> thats that. Not coming off as nose up in the air and

> too good to answer becuase I did something that no

> one likes and no one informed about the "rule."

> Basically, people didn't have to be rude to let me

> know the problem. Anyone could have checked my

> posts and saw that this was my first time doing

> this.

And this ranting helps you solve your urgent problem how?

> As for people ignoring, I think that sooner or later

> someone would answered.

Maybe. But it probably would've been answered sooner--and without all these distractions--if you'd not marked it urgent in the first place.

jverda at 2007-7-21 22:47:59 > top of Java-index,Java Essentials,New To Java...
# 27

> If its that big of a deal then people shouldn't have

> attacked me. It could have been said to me that its

> an unofficial rule that everyone here goes by and

> thats that. Not coming off as nose up in the air and

> too good to answer becuase I did something that no

> one likes and no one informed about the "rule."

> Basically, people didn't have to be rude to let me

> know the problem. Anyone could have checked my

> posts and saw that this was my first time doing

> this.

>

> As for people ignoring, I think that sooner or later

> someone would answered. Everyone gives and takes on

> a forum. That's the idea behind it. When I learn

> more I'll try to help people as well. I didn't think

> putting the urgency would cause such a problem.

Now you know!

ita6cgra at 2007-7-21 22:48:00 > top of Java-index,Java Essentials,New To Java...
# 28
>> Now you know!Yup
eristica at 2007-7-21 22:48:00 > top of Java-index,Java Essentials,New To Java...
# 29

> If its that big of a deal then people shouldn't have

> attacked me.

Attacked? That's a bit exaggerated.

> It could have been said to me that its

> an unofficial rule that everyone here goes by and

> thats that. Not coming off as nose up in the air and

> too good to answer becuase I did something that no

> one likes and no one informed about the "rule."

> Basically, people didn't have to be rude to let me

> know the problem. Anyone could have checked my

> posts and saw that this was my first time doing

> this.

You were told.

What do you expect? That everyone coming along here who's adding "URGENT!!!11!" in their subject line is led by the hand and told in a mother Theresa kind of way how to behave in public forums and what to expect from total strangers?

YOU are the one looking for help, yet you find that we should behave ourselves to YOUR standards? Piss off, little knobjockey! Now you're being attacked!

> As for people ignoring, I think that sooner or later

> someone would answered. Everyone gives and takes on

> a forum. That's the idea behind it. When I learn

> more I'll try to help people as well. I didn't think

> putting the urgency would cause such a problem.

Well, hopefully it sticks.

Buh-bye!

prometheuzza at 2007-7-21 22:48:00 > top of Java-index,Java Essentials,New To Java...
# 30
What standards did I put? If you want to help then help, if you don't then don't. I never demanded anything more than what people will do/not do.
eristica at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 31

> What standards did I put? If you want to help then

> help, if you don't then don't. I never demanded

> anything more than what people will do/not do.

Your attitude sucks. People do want to help. By pointing out your mistake, they're helping you not make it again. The way you handled that was extremely childish, as always seems to be the case these days. Drop the sense of entitlement, sonny, it won't get you very far in the real world

georgemca at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 32

> What standards did I put? If you want to help then

> help, if you don't then don't. I never demanded

> anything more than what people will do/not do.

And you were informed that what people will do is get irritated if you cry "URGENT!" because it implies your problem is more important than others', and that what some people won't do is answer those questions.

jverda at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 33

and the various people posting that I know but you don't and I'm not gonna tell neener neener isn't childish? there were quite a few of em. If they would have just said, "fyi, people don't like when you put urgent in a title. it makes people mad and not want to help." then it would have been fine but when people are going to act rude what do you think I do? All you people with 5k+ posts forget what it was like when you first use a forum i guess or start using the internet.

eristica at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 34
> What standards did I put? If you want to help then> help, if you don't then don't. I never demanded> anything more than what people will do/not do.Shouldn't you be in a presentation by now (with a unfinished piece of code)?; )
prometheuzza at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 35
I'm last to present. From what I can tell from teh book its not unfinished. I'm just going to try to use the teachers computer and see if he will tell me why it isn't working since its straight out of the book and the book says it should work.Message was edited by:
eristica at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 36

> and the various people posting that I know but you

> don't and I'm not gonna tell neener neener isn't

> childish?

I believe the comment was something like, "Since you used the word urgent, I'll help you tomorrow." You may consider it childish, but that's irrelevant. I consider it an object lesson, and I would imagine the person who said it does as well.

> there were quite a few of em. If they

> would have just said, "fyi, people don't like when

> you put urgent in a title. it makes people mad and

> not want to help." then it would have been fine but

How is that so different from what was actually said?

> when people are going to act rude what do you think I

> do? All you people with 5k+ posts forget what it was

> like when you first use a forum i guess or start

> using the internet.

I know I never tried to make my posts look more important than others'.

jverda at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 37

> and the various people posting that I know but you

> don't and I'm not gonna tell neener neener isn't

> childish? there were quite a few of em. If they

> would have just said, "fyi, people don't like when

> you put urgent in a title. it makes people mad and

> not want to help." then it would have been fine but

> when people are going to act rude what do you think I

> do? All you people with 5k+ posts forget what it was

> like when you first use a forum i guess or start

> using the internet.

Remember who's asking who for a favour. Personally, I can act as rude as I like because I'm not asking you for help. Being in the position of answering, rather than asking questions, that kind-of gives us the edge. Unfair, perhaps, but tough luck pal, that's life. This isn't a two-way street, you're asking us to help you, we don't owe you a thing. I have nothing at all to lose from being a rude, arrogant @sshole to you, you do not have that luxury

I remember only too well what it was like as a beginner. I remember only too well being picked up on forum behaviour. I also remember accepting it gracefully, and hearing no more about it.

georgemca at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 38

> I'm last to present. From what I can tell from teh

> book its not unfinished. I'm just going to try to

> use the teachers computer and see if he will tell me

> why it isn't working since its straight out of the

> book and the book says it should work.

>

> Message was edited by:

> eristic

Good luck with that. The code does work, I ran it about an hour ago

georgemca at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 39
> ...> Good luck with that. The code does work, I ran it> about an hour ago; )
prometheuzza at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 40
i had also copy this code in eclipse 3.2 & i have got 2 windows as results one is blue & another is pinki think the code is ok
paul1430a at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 41
> i had also copy this code in eclipse 3.2 & i have got> 2 windows as results one is blue & another is pink> i think the code is okIt is. The guy might have been told this earlier if he wasn't an oversensitive dickhole, too
georgemca at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 42

> > i had also copy this code in eclipse 3.2 & i have

> got

> > 2 windows as results one is blue & another is pink

> > i think the code is ok

>

> It is. The guy might have been told this earlier if

> he wasn't an oversensitive dickhole, too

Maybe he is color blind?

deAppela at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 43
Yes, the code worked on the teachers computer. I'm not sure how. See my link for the screen shot, they are clearly grey, not pink and blue how they are supposed to be.
eristica at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 44
> Yes, the code worked on the teachers computer. I'm> not sure how. See my link for the screen shot, they> are clearly grey, not pink and blue how they are> supposed to be.Does the text appear?
georgemca at 2007-7-21 22:48:05 > top of Java-index,Java Essentials,New To Java...
# 45
On the teachers, not on mine. It isn't really centered or anything, just smack dab in the content pane. http://i18.tinypic.com/5xepi0p.pngMessage was edited by: eristic
eristica at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 46

> On the teachers, not on mine.

>

> It isn't really centered or anything, just smack dab

> in the content pane.

>

> http://i18.tinypic.com/5xepi0p.png

>

> Message was edited by:

> eristic

Try moving the window slightly. With your mouse, I mean. Sometimes, especially on slower machines, they simply don't paint properly at first

georgemca at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 47
Nah I tried that. They first appear on top of each other in the top left corner. My laptop is a 1.8 ghz 2 gb of ram. Not a gaming machine but runs pretty smooth. This is why I am puzzled. Using 1.5, should work even though 1.6 is out.
eristica at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 48
You could try to make a test demo and see if the colord work there
deAppela at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 49
Try running it from command-line rather than through Eclipse
georgemca at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 50
Hey, I just ran the program on Ubuntu via Eclipse and it ran just fine... It also (obviously) ran fine using the command-line. Guess your computer is also trying to teach you a lesson :PLaginimaineb.
laginimaineba at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 51
Not to be insulting, but are you absolutely certain that the .class files that you're running are the ones that your .java files are being compiled into? I've had Eclipse goof me up a couple of times like that.
kevjavaa at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 52
Let me check. I pulled the files manually and command line it worked.
eristica at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 53

> Let me check. I pulled the files manually and

> command line it worked.

Drop the Eclipse, then. Do you have "build automatically" checked? IDE's are not a good idea for people who are still getting to grips with the language. They only seem like they are. Use command-line tools until you can solve this sort of problem yourself

georgemca at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 54
Ya, it auto saves, compiles and runs it for me. I think somewhere the files got goofed or something then. I was doing a lot of adding/removing. As you can see from teh screenie i have like 8 class files under that 1 project. I was testing a lot form teh book.
eristica at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 55

> Ya, it auto saves, compiles and runs it for me. I

> think somewhere the files got goofed or something

> then. I was doing a lot of adding/removing. As you

> can see from teh screenie i have like 8 class files

> under that 1 project. I was testing a lot form teh

> book.

I can't see that, because I haven't - and won't - follow the links. It's all well and good that Eclipse is doing some of the heavy lifting for you, but there are a multitude of ways in which an IDE can hide things you don't want hidden, or behave in ways you don't know about. You're better off not using it for now, trust me

georgemca at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 56

> Ya, it auto saves, compiles and runs it for me. I

> think somewhere the files got goofed or something

> then. I was doing a lot of adding/removing. As you

> can see from teh screenie i have like 8 class files

> under that 1 project. I was testing a lot form teh

> book.

Eight classes isn't much. Try closing the project then opening it again. That seems to solve all the problems I have with Eclipse.

CaptainMorgan08a at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 57

Another possibility is that your hardware acceleration settings in Windows (that is, if you are using Windows) is causing this problem.

I had a similar problem where a user was running a tool I wrote and the dialogs kept coming up blank/greyed out on his machine, while it worked fine on others.

Reducing the hardware acceleration solved the problem (he was running 2000).

For XP, go to the Display Properties dialog Settings tab, click on 'Advanced', and then to 'Troubleshoot' in the next dialog.

Adjust the Hardware Acceleration bar and then try and run your test program.

For instance, my acceleration is set to the third tick mark from 'None'.

I had to reduce my acceleration to get Jigloo to display my GUI class' visual representations in Eclipse.

cimmerian76a at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 58
My guess is that his app. is launching in the same JVM as Eclipse, and doesn't quite get the resources it needs. It runs ok from the command-line apparently.Bit academic now, really. It's no longer URGENT, he's already presenting it
georgemca at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 59
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=780103The thread I started that sounds similar to this problem, for reference.
cimmerian76a at 2007-7-21 22:48:10 > top of Java-index,Java Essentials,New To Java...
# 60

> http://forum.java.sun.com/thread.jspa?forumID=57&threa

> dID=780103

>

> The thread I started that sounds similar to this

> problem, for reference.

And that thread in turn delegates to another thread for an actual answer! It really is true then, a layer of indirection solves every problem

georgemca at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 61

> And that thread in turn delegates to another thread

> for an actual answer! It really is true then, a layer

> of indirection solves every problem

Which is why having multiple layers of inheritance is a great idea! A good rule of thumb is that if you don't have ten or more layers of inheritance, your code is not professional enough.

Djaunla at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 62
Java forums are very Kevin Bacon-esque apparently.But, I then redirected the indirection by referring to and describing the solution in the latter posts of the TIQ (thread-in-question) - barring the 'how-to' for reducing HW acc. That's what google is for... ;).
cimmerian76a at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 63

> > And that thread in turn delegates to another

> thread

> > for an actual answer! It really is true then, a

> layer

> > of indirection solves every problem

>

> Which is why having multiple layers of inheritance is

> a great idea! A good rule of thumb is that if you

> don't have ten or more layers of inheritance, your

> code is not professional enough.

In that case, I work with some of the most professional coders on the face of the planet

georgemca at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 64
> In that case, I work with some of the most> professional coders on the face of the planetYeah, buddy...kickin' it new-school... IBM-style.
kevjavaa at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 65

> My guess is that his app. is launching in the same

> JVM as Eclipse, and doesn't quite get the resources

> it needs. It runs ok from the command-line

> apparently.

I wonder if reducing the HW acc might free up enough resources to allow both the OP's dialogs and Eclipse to be rendered properly?

I've run plenty of GUI apps from Eclipse myself while debugging/testing and never had trouble.

I did have trouble at one point with Jigloo in Eclipse. The GUI classes were being displayed as just black squares in the visual editor.

Dropping the HW acc. fixed that problem for me.

Just speculating....

cimmerian76a at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 66
I'm running Ubuntu 7.04. Looking up how to adjust hw acceleration.
eristica at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 67
reinstall your javamay be some file in lib is missing/corrupted
paul1430a at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 68
reinstall your javamay be some file in lib is missing/corrupted
paul1430a at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 69
> reinstall your java> may be some file in lib is missing/corruptedWhy, then, does it work ok outside of Eclipse?
georgemca at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...
# 70
> reinstall your java> may be some file in lib is missing/corrupted1 - it works from the prompt;2 - if "some lib" is missing/corrupted, it wouldn't even compile.
prometheuzza at 2007-7-21 22:48:15 > top of Java-index,Java Essentials,New To Java...