This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Choosing a layout manager for card simulation

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a program that will help me remember new vocabulary by showing a word in English and letting me guess the foriegn language equivalent.
At the moment I use paper cards for this. The English word is one one side of a card, the foreign word is on the other.


I have a WordCard object

WordCard
String EnglishWord
String ForeignWord
Integer ID
Integer Array GuessHistory []



I imagine the WordsCardGUI will display as follows

WordCardGUI
JLabel = EnglishWord
JTextField = ForeignWord
JButton = "Try" this.compare()
JButton = "ShowAnswer" this.reveal ()



MainInterface GUI
(not sure what this needs to do yet, any ideas would be great)
GetNewCards()
GetIncorrectGuessedCards()



My question is.


Which display layout is best for this task?
I would like to be able to view up to 7 cards on screen at once.
I know there is a cardlayout manager but is this the best suited one to use? My intution tends towards each card in a seperate panel.
 
Bartender
Posts: 1840
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the sound of it, I think you want a Flow Layout containing 7 different JPanels, each of which has a Card layout. Each card layout contains 2 cards: The Foreign card and the English card. (Probably this is 7 instances of a specific class that extends JPanel, since all that's different is the data...)

Anyway, I think this is best suited to our Swing forum, so I'm moving it there.
 
ric hill
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this program will dislay two cards, I understand most of it apart from the line




Does the container pane begin exist only here? Shouldnt it be declared and initialised first?


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!