Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A sort of drop down-menu

 
Gabriella Hakansson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

I think this question may fare better in the GUI forum

I'll move it there.
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gabriella Hakansson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Is there any way you can do it nicely so the answer don't just pops out but slides down?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic