• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URGENT application ok ...applet not ok

 
Cliff Top
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Any of you guru's have an idea about the following.
by the way...just passed the SCJP with 88% but it hasnt helped me with this monkey:-(

Ive been developing a program that gives the user a tree structure on the left hand side of the display and depending on what they select from this tree, a different set of options on the rhs.

The problem is..... it all works fine as an application.
But when i deliver it as an applet i have the following problems on the rhs of the display.

1) Jtextfields are NOT editable??? i can click on them and they seem to get focus but cant edit the dam things.
2) the background colo(u)r for the jPanels, JTextField, Combi Boxes etc are all grey in the applet only. To overcome this I have to explicitly setOpaque to false for every component.

As I have said....it works fine as an application.

I have been randomly repainting things in different ways with no luck.

I cant help thinking this is one of those one liners that'll fix everything.

Anyone got any ideas???

Got to deliver this in 26 1/2 hours.....doh.

Thats 1/2 hour gone.........26 hour till i get fried:-/

Please help ASAP

Many thanks

ps using removeAll, then add(JPanelWithNewDisplayStuff)
Then various combinations of validate revalidate paint repaint to update the display.
 
Joe Ess
Bartender
Posts: 9337
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Cliff Top:

Anyone got any ideas???

Not that it will help in your current situation, but Test Early, Test Often. And by test, I mean "test in the environment the application will be deployed in".


ps using removeAll, then add(JPanelWithNewDisplayStuff)
Then various combinations of validate revalidate paint repaint to update the display.


Without seeing your code I can't really help other than to say the above is pretty ugly. You should look into CardLayout which provides the required functionality with a much cleaner interface.
If you need further assistance, boil your problem down to the smallest possible example (we don't want to see your whole app) and let us know what JDK you are developing with and what JVM your browser is using.
 
Cliff Top
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed it.
Part of the initialisation was done using invokeLater.
Different EventQueues used for Comms events and invokeLater causing incorrect initialisation in the browser environment.

Rather than calling invokeLater I used....

private EventQueue mEventQueue;
mEventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();

public void invokeProperly(Runnable r)
{
mEventQueue.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), r));
}

Will look at CardLayout and Test in the deployment environment earlier next time.

Thanks for the advice.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic