I'm having the same question...
Is there anyway to print multiple lines into an AWT Label?
(I can not use a JLabel for what I'm trying to do.)
Any help or links offered would be appreciated.
Joe McTigue wrote:(I can not use a JLabel for what I'm trying to do.)
Would you care to elaborate why not?
luck, db
There are no new questions, but there may be new answers.
Joe McTigue
Ranch Hand
Joined: Mar 05, 2012
Posts: 52
posted
0
elaborating...
I'm creating a test which displays an answer selection area (JPanel) which would have a series of possible answers categorized by letter.
each question would have as many as 15 possible answers to select from, or as little as three answers to select from.
I choose awt Checkbox's because JCheckBox's can not be removed or added to the JPanel at runtime.
example: (keep in mind the "|_|" are my checkboxes)
Question: 1
what is your favorite color?
Select the correct answer:
|_| A.) I like the color Blue best because it is the color of the // I'll need some to be multi-line checkboxes.
sky and water, my favorite two things on the planet.
|_| B.) I like the color Green best because it is the color of lush
forrest and jungles and I really like to explore.
Question: 2
what is your least favorite color?
Select the correct answer:
|_| A.) Blue
|_| B.) Green
|_| C.) Yellow // I don't want checkbox 'C' to show up in the selections for Question 3.
Question: 3
Which of the previous two questions did you like most?
++ to what Matthew said. Additionally, the appropriate Swing UI for selecting one of many options would be a bunch of JRadioButtons added to a ButtonGroup -- not JCheckBoxes at all.
edit: and as this has nothing at all to do with the subject of the thread you posted in, which is "multi line in a java.awt.Label" I'm splitting this discussion into a new thread.
Joe McTigue
Ranch Hand
Joined: Mar 05, 2012
Posts: 52
posted
0
@Matthew Brown:
If this can be done with JCheckBoxes, please tell me how one can dynamically remove a
JCheckBox from a JPanel and how to add a JCheckBox onto a JPanel during runtime.
@Darryl Burke:
Each question can have multiple answers.
Thanks in advance for any informative answers you can provide in advance.