This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Center text in message box  RSS feed

 
Jason Job
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are working on a project in GUI and we're all new to it, however I'd like to make text output pretty.



Is my current about message box. I'd like to know how to center all of this text.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try HTML
 
Jason Job
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're currently just taking a program we had designed to generate a payroll, and just trying to make it gui based. Would there be any way to do it within the java gui?
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You could use HTML along with the text in that very code right there.
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing has limited HTML support in its labels (not just JLabel but also labels of other components). You can use most of the HTML 3.2 formatting tags (like <p>, <b>, etc), as long as the text starts with <html>.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!