Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes A sort of drop down-menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "A sort of drop down-menu" Watch "A sort of drop down-menu" New topic
Author

A sort of drop down-menu

Gabriella Hakansson
Greenhorn

Joined: Apr 19, 2010
Posts: 6
I have built some java-apps but i have never done it without my teatcher nearby. Til now. So i am going to build an app where you can click on some text and then get other text underneath. Like having simple FAQ's and the user can only see the questions and when he/she clicks on a question the answer slides down underneath. Somehow i should do this so it looks nice. I have no idea how to even start, so any help, tutoral or anything is helpful.


Also: I know how to make the visual background. I will use a JFrame. The thing that i cant do is the "click-on-text-and-other-text-appears-underneath". Should I use HTML? How do i do that ? Or is a simple JLable enough?

And i just have to add that i'm not in school, i am out of ideas to search on google and i don't know how to start.


Just trying to be a good programmer.
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1659
    
  11

Welcome to JavaRanch!

I think this question may fare better in the GUI forum

I'll move it there.


When you do things right, people won't be sure you've done anything at all.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

JLabel supports HTML and has a convenient setText() method.
You can use a mouse listener to trap the user clicks, on which you can display the hidden text.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Gabriella Hakansson
Greenhorn

Joined: Apr 19, 2010
Posts: 6
Thank you Is there any way you can do it nicely so the answer don't just pops out but slides down?
 
Consider Paul's rocket mass heater.
 
subject: A sort of drop down-menu
 
Similar Threads
Drop down list from combo box hides behind buttons
Passed!!! 151/155
Servlet Communication with different Server?
Please help Newbie
New Swing Application