hi guys,
i have problems with adding the jscrollpane to jdesktoppanel, here is my code if any spot a mistake really appreciate it if u could send a reply
many tanx
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* NewJFrame2.java
*
* Created on 02-Nov-2009, 18:05:56
*/
package Frames;
/**
*
* @author qyt21516
*/
public class NewJFrame2 extends javax.swing.JFrame {
/** Creates new form NewJFrame2 */
public NewJFrame2() {
initComponents();
}
/** 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() {
jSplitPane1 = new javax.swing.JSplitPane();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jDesktopPane1 = new javax.swing.JDesktopPane();
jInternalFrame1 = new javax.swing.JInternalFrame();
jInternalFrame2 = new javax.swing.JInternalFrame();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstan ts.EXIT_ON_CLOSE);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
.addGap(0, 255, Short.MAX_VALUE)
);
jSplitPane1.setLeftComponent(jPanel1);
jInternalFrame1.setVisible(true);
javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContent Pane());
jInternalFrame1.getContentPane().setLayout(jIntern alFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(javax.sw ing.GroupLayout.Alignment.LEADING)
.addGap(0, 90, Short.MAX_VALUE)
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(javax.sw ing.GroupLayout.Alignment.LEADING)
.addGap(0, 75, Short.MAX_VALUE)
);
jInternalFrame1.setBounds(60, 50, 100, 110);
jDesktopPane1.add(jInternalFrame1, javax.swing.JLayeredPane.DEFAULT_LAYER);
jInternalFrame2.setVisible(true);
javax.swing.GroupLayout jInternalFrame2Layout = new javax.swing.GroupLayout(jInternalFrame2.getContent Pane());
jInternalFrame2.getContentPane().setLayout(jIntern alFrame2Layout);
jInternalFrame2Layout.setHorizontalGroup(
jInternalFrame2Layout.createParallelGroup(javax.sw ing.GroupLayout.Alignment.LEADING)
.addGap(0, 80, Short.MAX_VALUE)
);
jInternalFrame2Layout.setVerticalGroup(
jInternalFrame2Layout.createParallelGroup(javax.sw ing.GroupLayout.Alignment.LEADING)
.addGap(0, 75, Short.MAX_VALUE)
);
jInternalFrame2.setBounds(170, 100, 90, 110);
jDesktopPane1.add(jInternalFrame2, javax.swing.JLayeredPane.DEFAULT_LAYER);
jScrollPane1.setViewportView(jDesktopPane1);
jSplitPane1.setRightComponent(jScrollPane1);
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 257, 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 NewJFrame2().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JInternalFrame jInternalFrame2;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSplitPane jSplitPane1;
// End of variables declaration
}