我对Java的问题很奇怪,我的应用程序在Windows XP上看起来很好,但它在Windows 7上看起来很奇怪(布局刚刚解体)。有没有人有同样的问题? TextFields大小不同。
GroupLayout gl_panel = new GroupLayout(this);
gl_panel.setHorizontalGroup(
gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gl_panel.createSequentialGroup()
.addContainerGap()
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblPulseFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblChannelDelay_4, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(lblChannelDelay, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(lblChannelDelay_1, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(lblChannelDelay_2, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(lblChannelDelay_3, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(lblBlankingTime, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(pulseFreqTextField, javax.swing.GroupLayout.Alignment.TRAILING, 0, 0, Short.MAX_VALUE)
.addComponent(blankingTimeTextField, 0, 0, Short.MAX_VALUE)
.addComponent(textField_9)
.addComponent(textField_8)
.addComponent(textField_7)
.addComponent(textField_6)
.addComponent(textField_5, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gl_panel.createSequentialGroup()
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblus_3)
.addComponent(lblus_2)
.addComponent(lblus_1)
.addComponent(lblus)
.addComponent(lblus_4))
.addGap(18, 18, 18)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblChannelDelay_5, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE)
.addComponent(lblChannelDelay_6)
.addComponent(lblChannelDelay_7, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE)
.addComponent(lblChannelDelay_8, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE)
.addComponent(lblChannelDelay_9, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(textField_14)
.addComponent(textField_13)
.addComponent(textField_12)
.addComponent(textField_11)
.addComponent(textField_10, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(lblus_6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblus_5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblus_7, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblus_8, javax.swing.GroupLayout.Alignment.LEADING))
.addComponent(lblus_9))
.addGap(230, 230, 230))
.addGroup(gl_panel.createSequentialGroup()
.addComponent(lblkhz)
.addContainerGap())))
);
gl_panel.setVerticalGroup(
gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gl_panel.createSequentialGroup()
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gl_panel.createSequentialGroup()
.addGap(117, 117, 117)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblChannelDelay)
.addComponent(textField_5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus)
.addComponent(lblChannelDelay_5)
.addComponent(textField_10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_5, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblChannelDelay_1)
.addComponent(textField_6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_1)
.addComponent(lblChannelDelay_6)
.addComponent(textField_11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblChannelDelay_2)
.addComponent(textField_7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_2)
.addComponent(lblChannelDelay_7, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textField_12, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblChannelDelay_3)
.addComponent(textField_8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_3)
.addComponent(lblChannelDelay_8)
.addComponent(textField_13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblChannelDelay_4)
.addComponent(textField_9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblus_4)
.addComponent(lblChannelDelay_9)
.addComponent(textField_14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblus_9))))
.addGroup(gl_panel.createSequentialGroup()
.addGap(42, 42, 42)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblPulseFrequency)
.addComponent(pulseFreqTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblkhz))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(gl_panel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblBlankingTime)
.addComponent(blankingTimeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(35, Short.MAX_VALUE))
);