Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Any Java applet gurus on here?

Thread Tools
 
Search this Thread
 
Old Jul 30, 2003 | 09:11 PM
  #1  
Iain Young's Avatar
Iain Young
Thread Starter
Scooby Regular
 
Joined: Sep 1999
Posts: 6,956
Likes: 0
From: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Cool

Hi folks,

Probably a long shot this, but I'm attempting to write a drop down menu using a java applet (because I need the dropdowns to appear accross frames etc). Now I can get it working fine using the awt PopupMenu class, but these look a bit boring as they only come up in the system default colour and you can't insert images etc.

I've tried switching over to using swing instead, but am having loads of problems. I can get the menu to appear, but it won't cancel when I click on the web page. This works when using awt so I guess it's something to do with the way swing works.

So anyone got any suggestions as to what I should use to create a really nice looking java drop down menu, or is awt the only way to go?

Thanks,
Iain
Reply
Old Jul 31, 2003 | 07:22 AM
  #2  
CTR's Avatar
CTR
Scooby Regular
 
Joined: Jun 2002
Posts: 348
Likes: 0
Post

Which JVM are you using, if you are using the JVM that comes with the browsers Im surprised it works at all. Try using Suns plugin JVM, although saying that the repainting in Swing doesnt seem to be that great anyway. I think there is some call like repaint you can call after the selection has been made which should do the repainting for you.
Reply
Old Jul 31, 2003 | 09:37 AM
  #3  
Iain Young's Avatar
Iain Young
Thread Starter
Scooby Regular
 
Joined: Sep 1999
Posts: 6,956
Likes: 0
From: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Post

I was using the sun jvm (latest version) and was calling repaint, but it still didn't work. I guess I'll have to stick to awt. Frustrating though, all I wanted to do was change the background colours...

Thanks,
Iain
Reply
Old Jul 31, 2003 | 10:04 AM
  #4  
CTR's Avatar
CTR
Scooby Regular
 
Joined: Jun 2002
Posts: 348
Likes: 0
Post

Looking back at some of my code, try doing a

getContentPane().repaint()

in both the Menu Listener functions
MenuDeselected
MenuCanceled

You may already have tried it, but...

Oh and thats assuming that you have implemented the MenuListener in your Applet class. Else get the content pane of the Applet then call repaint.


[Edited by CTR - 7/31/2003 10:05:07 AM]

[Edited by CTR - 7/31/2003 10:06:20 AM]
Reply
Old Jul 31, 2003 | 10:15 AM
  #5  
Iain Young's Avatar
Iain Young
Thread Starter
Scooby Regular
 
Joined: Sep 1999
Posts: 6,956
Likes: 0
From: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Smile

Thanks, I'll check but I think I did do that, (although it was late last night so I'm not sure what I was doing tbh ). Looking around on the web, it looks as though all of the commercial menu applets use awt so perhaps swing is just to fiddly to be bothering with...

Cheers,
Iain
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
father_jack
Computer & Technology Related
3
Aug 14, 2002 11:13 AM
ozzy
Computer & Technology Related
17
Jul 16, 2002 05:16 PM




All times are GMT +1. The time now is 04:12 AM.