This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add user input in a panel??  RSS feed

 
Luong Vuong
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have created a panel:



Is there anyway of using the panel to accept user input, in this case the number of triangles.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, of course! You can accept input in a TextField.

Moving to Swing/AWT/JFace/SWT.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(looks like you may be using awt only).

a TextField is the normal way to handle user input, but you need to include
a fair amount of error handling. If the range of 'number of triangles' is limited,
it might be easier for you to use a java.awt.Choice, where the user can select
the number from a range you have set.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!