问题已经解决。。 本帖最后由 douzhiwt 于 2011-08-10 14:16:18 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.awt.*;import javax.swing.*;public class zb3 extends javax.swing.JFrame { /** Creates new form zb */ public zb3() { initComponents(); ms(); } private void ms(){ jpAll=new JPanel(); jpAll.setSize(100,100); jpAll.setLayout(new GridLayout(4, 1)); jScrollPane1.add(jpAll); JButton jb = new JButton("aaa"); jb.setPreferredSize(new Dimension(100, 200)); jpAll.add(jb); JButton jb2 = new JButton("bbbb"); jpAll.add(jb2); JButton jb3 = new JButton("ccccccc"); jpAll.add(jb3); JButton jb4 = new JButton("Ddddd"); jpAll.add(jb4); jpAll.show(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); jlbTitle1 = new javax.swing.JLabel(); jlbTishi = new javax.swing.JLabel(); jlbTitle2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jScrollPane1.setName("jScrollPane1"); // NOI18N jScrollPane1.getViewport().setBackground(Color.red); jScrollPane1.setVerticalScrollBar(new JScrollBar()); jlbTitle1.setText("版号版名"); jlbTitle1.setName("jlbTitle1"); // NOI18N jlbTishi.setText("提示信息"); jlbTishi.setName("jlbTishi"); // NOI18N jlbTitle2.setText("版号版名"); jlbTitle2.setName("jlbTitle2"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(79, 79, 79) .addComponent(jlbTitle2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(131, 131, 131) .addComponent(jlbTishi) .addGap(143, 143, 143) .addComponent(jlbTitle1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jlbTitle2) .addComponent(jlbTishi) .addComponent(jlbTitle1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE) .addContainerGap()) ); pack(); }// </editor-fold> /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new zb3().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel jlbTishi; private javax.swing.JLabel jlbTitle1; private javax.swing.JLabel jlbTitle2; // End of variables declaration private javax.swing.JPanel jpAll;} JTextField内容为空时读取的值的测试 关于Java垃圾回收器的一个问题 FileInputStream文件流的读取问题 html页面 document.getelementbyid 和form.id的区别,很纳闷的问题. 不知道这个理解对不对 关于HelloWorld? 初学java数据库编程,请教。100分相送。。。 SQLJ是标准吗?Java什么版本支持?还是只有几个数据库支持? 请教一个关于java多线程的问题 JCombox的问题? 数流行语言 还看今朝 O北京额草他、 http上传和下载范例
import javax.swing.*;public class zb3 extends javax.swing.JFrame { /** Creates new form zb */
public zb3() {
initComponents();
ms();
}
private void ms(){
jpAll=new JPanel();
jpAll.setSize(100,100);
jpAll.setLayout(new GridLayout(4, 1));
jScrollPane1.add(jpAll); JButton jb = new JButton("aaa");
jb.setPreferredSize(new Dimension(100, 200));
jpAll.add(jb); JButton jb2 = new JButton("bbbb");
jpAll.add(jb2); JButton jb3 = new JButton("ccccccc"); jpAll.add(jb3); JButton jb4 = new JButton("Ddddd"); jpAll.add(jb4);
jpAll.show();
} /** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jlbTitle1 = new javax.swing.JLabel();
jlbTishi = new javax.swing.JLabel();
jlbTitle2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jScrollPane1.setName("jScrollPane1"); // NOI18N
jScrollPane1.getViewport().setBackground(Color.red);
jScrollPane1.setVerticalScrollBar(new JScrollBar()); jlbTitle1.setText("版号版名");
jlbTitle1.setName("jlbTitle1"); // NOI18N jlbTishi.setText("提示信息");
jlbTishi.setName("jlbTishi"); // NOI18N jlbTitle2.setText("版号版名");
jlbTitle2.setName("jlbTitle2"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(79, 79, 79)
.addComponent(jlbTitle2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(131, 131, 131)
.addComponent(jlbTishi)
.addGap(143, 143, 143)
.addComponent(jlbTitle1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jlbTitle2)
.addComponent(jlbTishi)
.addComponent(jlbTitle1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
.addContainerGap())
); pack();
}// </editor-fold> /**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new zb3().setVisible(true);
}
});
} // Variables declaration - do not modify
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel jlbTishi;
private javax.swing.JLabel jlbTitle1;
private javax.swing.JLabel jlbTitle2;
// End of variables declaration
private javax.swing.JPanel jpAll;
}