[英]I'm adding a combobox to someone's existing Swing code. What am I doing wrong here?
.addGroup(makeBookingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel48)
.addComponent(sittingPull, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bookingTime2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
I'm trying to place bookingTime2 after sittingPull, to the right. 我正尝试在坐在右侧之后的BookingP2之后放置bookingTime2。 I realise with the current parameters I'm placing them in the same place. 我意识到使用当前参数将它们放置在同一位置。 I don't understand default_size or preferred_size though. 我不明白default_size或preferred_size。 How do I change these parameters to achieve what I want? 如何更改这些参数以实现所需的功能?
you have (last two code lines in void
or contructor
) call for JComboBox's container
您有(在void
或contructor
最后两个代码行)调用JComboBox's container
Xxx.revalidate();
Xxx.repaint();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.