• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A sort of drop down-menu

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

I think this question may fare better in the GUI forum

I'll move it there.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic