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 30 July 2003, 09:11 PM
  #1  
Iain Young
Scooby Regular
Thread Starter
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
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
Old 31 July 2003, 07:22 AM
  #2  
CTR
Scooby Regular
 
CTR's Avatar
 
Join Date: Jun 2002
Posts: 348
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 31 July 2003, 09:37 AM
  #3  
Iain Young
Scooby Regular
Thread Starter
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
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
Old 31 July 2003, 10:04 AM
  #4  
CTR
Scooby Regular
 
CTR's Avatar
 
Join Date: Jun 2002
Posts: 348
Likes: 0
Received 0 Likes on 0 Posts
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]
Old 31 July 2003, 10:15 AM
  #5  
Iain Young
Scooby Regular
Thread Starter
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
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
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
father_jack
Computer & Technology Related
3
14 August 2002 11:13 AM
ozzy
Computer & Technology Related
17
16 July 2002 05:16 PM



Quick Reply: Any Java applet gurus on here?



All times are GMT +1. The time now is 02:21 AM.