• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confirmation dialog aligning

 
rinke hoekstra
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[urlybird 1.1.1]

Hi all,

I decided to keep the gui design as simple as possible, that is, for all small dialogs I use JOptionPane.show...Dialog.

Also for the confirmation Dialog for booking.
In this dialog, I want to list all fieldnames for the room, followed by their
values, a bit like this:

The following room will be booked:

Name: ...
Location: ...
...

by customer number: ...

Are you sure??


Now, when I pass a simple String with linebreaks \n, the aligning of the fields of the room is quite lousy. Of course there is the possibility to pass a whole JPanel with a BoxLayout and JTable plus JLabels as message into the JOptionPane, but that makes the motivation for using JOptionPane rather silly, as my goal was to keep it really simple.

So:

Is there a simple way in lining out the fieldnames a bit nice, so that it doesn't look that messy, but doesn't involve all these complicated stuff which I wanted to avoid by using JOptionPane?

Are people displaying such a dialog anyways, and if yes, with a simple JOptionPane? Or are you building a complete Dialog with layout manager, panel, buttons, actionhandler, etc?
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

not that I especially think it is a good idea, but I believe you could use HTML syntax to align your text nicer in a JOptionPane.

<table><tr><td>....

regards,
Alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic