• Post Reply Bookmark Topic Watch Topic
  • New Topic

Possible to have a JPanel with north/center/south border layout in a JOptionPane ?

 
Norbert Lebenthal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I put a panel in a JOptionPane this way:


this bookingConfirmationPanel has the 3 following content:




however all the content is shown on one line... Something like: confirmationTableLabel scrollPane bookingOwnerPanel

Is it possible to have vertically arranged, ie this way
confirmationTableLabel
scrollPane
bookingOwnerPanel

which I was expecting due to the border layout settings I put.

Side question: do you feel like asking extra input in a JOptionPane.QUESTION_MESSAGE is bad/strange?

thanks a lot !

merry christmas !

norbert
 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

You probably forgot to set the layout of the panel. The BorderLayout constraints aren't magical.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Side question: do you feel like asking extra input in a JOptionPane.QUESTION_MESSAGE is bad/strange?

No. That's the easiest way to manipulate the dialog icons.
Why do you think it is bad/strange?
 
Norbert Lebenthal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

You're right. Being new to swing I didn't even think of it at the time. sorry

Darryl Burke wrote:
You probably forgot to set the layout of the panel. The BorderLayout constraints aren't magical.


indeed :$

Did I say I'm new to swing ? :$

Maneesh Godbole wrote:
Side question: do you feel like asking extra input in a JOptionPane.QUESTION_MESSAGE is bad/strange?

No. That's the easiest way to manipulate the dialog icons.
Why do you think it is bad/strange?


well, normally such kind of modal window are mainly for kind of short messages I thought. So I had doubts about my choice...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!