Menu

[solved]-Two Font Objects Call Namefont Datefont Set Whatever Name Style Size Wish Make Sure Differ Q39011915

  • Two Font objects. Call them nameFont and dateFont. Set them towhatever name, style, and size that you wish. Just make sure theyare different.
  • Two Color objects. Call them nameColor and dateColor. In oneuse the whole number constructor to create a custom color for yourname. In the other use the constructor that takes floating pointnumbers as percentages to create a color for the date.
  • An instance of the content pane so that you can add componentsto it.
  • Create three JLabels one called lblFName which has your firstname in it, one called lblLName that has your last name in it, andone called lblDate that has the date in it.

Create a constructor that will allow you to initialize yourapplication. In it:

  • Set the application to visible, the size to 300, 300, the titleto “First GUI App”, and the default close operation toEXIT_ON_CLOSE
  • Set the layout of the content pane to a GridLayout that is 3rows by 1 column.
  • Set the text color and Font to the JLabels that hold you nameand date using the Font and Color objects you created.
  • Add the JLabels to the content pane. In the order of, FirstName, Last Name, Date.

When finished your application should look like this:

6 First GUI App - 0 X Glenn Stevenson Oct. 12, 2014

6 First GUI App – 0 X Glenn Stevenson Oct. 12, 2014 Show transcribed image text 6 First GUI App – 0 X Glenn Stevenson Oct. 12, 2014

Expert Answer


Answer to Two Font objects. Call them nameFont and dateFont. Set them to whatever name, style, and size that you wish. Just make s… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *