• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

frames within applet

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i wish that if i click a particular point in my applet then a small frame window should popup on the screen with the applet always being there in the background.how do i go about solving it?
thanks in advance
regards
karan
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's some code that should help you out...

It shows how to add a frame to an applet, and how to launch that frame when a certain area on the applet is pressed.



HTH,
-Nate
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the reply nathan,i actually figured it out earlier in the weekend.now i am able to do what i wanted to do,ie,display a frame on clicking certain area in the applet but now my problem is that i want to display something in the frame based on the region of the applet that has been clicked,ie,for different clicked area i will have something different written on the frame.for this i have to get the applet and the frame class communicate with each other(i have 2 classes,one for applet and one for frame).can u give me some idea as to how to get this done.i will appreciate it.
regards
karan
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could give the Frame a CardLayout, and have a different "card" display based on where you clicked. You could also have several seperate frames, and which one is launched depends on where the user clicked. I personally think that the first solution is a better one...

Here is a slightly modified version of the code above that may help you out...



HTH,
-Nate
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks nathan,i did it myself by following a methodology which is kinda similar to what u suggested but with out using any layout managers..
thanks
karan
 
reply
    Bookmark Topic Watch Topic
  • New Topic