![](/img/trans.png)
[英]I'm getting weird errors for seemingly simple Java code. What am I doing wrong here?
[英]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)
我正嘗試在坐在右側之后的BookingP2之后放置bookingTime2。 我意識到使用當前參數將它們放置在同一位置。 我不明白default_size或preferred_size。 如何更改這些參數以實現所需的功能?
您有(在void
或contructor
最后兩個代碼行)調用JComboBox's container
Xxx.revalidate();
Xxx.repaint();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.