Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

BoxLayout, GridLayout, or GridBagLayout would all work.
http://download.oracle.com/javase/tutorial/uiswing/layout/index.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

657

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, actually that isn't relevant to the question at all.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Then I guess you are out of luck.

Seriously, you haven't said why getSource() won't work (it will by the way) and you haven't given any good reason not to define separate listeners. You can define separate listeners as inner classes, anonymous or named.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Great! :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would recommend constructing your UI components as you normally would, outside of the done() method, and just use done() to add the List contents.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try adding some println statements to monitor what's going on in your task and print stack traces in your catch blocks. You're deliberately blinding yourself to exceptions with empty catch blocks.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just glancing real quick, if upperLeftY reaches 0 you hit the top and can reset to the starting Y position?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You have to call worker.execute() to execute the task. Your code above is just the declaration.

The SwingWorker API doc has some notes on its usage as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

657

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Remove the left parenthesis so you just have }; It's just a minor syntax error in the anonymous class declaration.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

655

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take a look through this tutorial on concurrency in Swing

SwingWorker invokes a worker thread in the background that does not tie up the event queue. SwingWorker may publish results for updates on the event queue, but it does not have to.

SwingUtilities.invokeLater() schedules a task to run on the event queue. While the task runs, nothing else on the event queue will be processed - so your GUI will be unresponsive pending completion of that task. That is why you don't want to process long-running tasks directly on the event queue.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your class outline already has pretty straightforward instructions.

Ask specific questions about the parts which confuse you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

arm > nukes

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

sign > hand

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually... we already did on Jan 20th, 2009 (page 43)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

hand > stop

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

651

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

point > finger

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

647

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

643

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Judging from all of the people I see staring at them with blank faces, I thought they already were stun devices.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

639

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

buzz > haircut

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

635

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

anger > frustration

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

631

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

shopping > torture

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

627

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

down > town

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

629

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

"Beast and the Harlot" A7X

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

all-in-one printer > copy

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Oh, yeah, I guess they did announce that today? I already forgot...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Help with what?

How to use code tags maybe? Select your code and click the button on the editor that says [code]

How to properly post a question? Use a descriptive title, not just "help" or "urgent" (trust me, it's not urgent to anyone else). Describe the problem. Post specific error messages and stack traces if you have them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You don't have to name the class, just the reference you're creating.

Thread t = new Thread()
        {
            @Override
            public void run()
            {
                while(true)
                {
                    //Update loop stuff
                }
            }
        };
t.setDaemon(true);
t.start();
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

mirror > reflect

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

broken > shatter

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

injury > damaged

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, as Kramerd suggested, you'll need to create the Thread object, setDaemon(), and then start it.

The setDaemon() method is a void return, so you cannot chain it as you tried above. If setDaemon() returned a reference to itself then chaining would be possible.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

pub > darts

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

drink > bourbon

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

ice > glacier

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Or just create your own small wrapper model.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No one is going to answer quiz questions for you.

Formulate your own answers and if you have uncertainties, ask specific questions. Explain your reasoning or thoughts on the areas you doubt,

Demonstrate some effort in the process if you want others to take their own time to help you.

jon.kiparsky commented: Testify, brother. +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@walexy: No, you're just going to have to do your own work.