На первый взгляд, у вас автоматически появляется JFrame, как только вы расширяете JFrame.Доска - это JFrame и рамка не нужна.Изучите учебник , особенно раздел Swing.
public class Board extends JFrame implements MouseListener,ActionListener {
public int x1, y1, x2, y2;
public Board() {
JFrame frame = new JFrame();
frame.setSize(1200, 800);
Container con = frame.getContentPane();
con.setBackground(Color.RED);
addMouseListener(this);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
...
должно быть:
public class Board extends JFrame implements MouseListener,ActionListener {
public int x1, y1, x2, y2;
public Board() {
setSize(1200, 800);
Container con = getContentPane();
con.setBackground(Color.RED);
addMouseListener(this);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
...
Вот обобщенный подход JSplitPane, свежий из NetBeans:
public class NewJFrame1 extends javax.swing.JFrame {
/** Creates new form NewJFrame1 */
public NewJFrame1() {
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();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jSplitPane1.setBorder(null);
jSplitPane1.setDividerLocation(100);
jSplitPane1.setDividerSize(1);
jSplitPane1.setEnabled(false);
jPanel1.setBackground(new java.awt.Color(153, 153, 153));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
jSplitPane1.setLeftComponent(jPanel1);
jPanel2.setBackground(new java.awt.Color(255, 0, 0));
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 299, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
jSplitPane1.setRightComponent(jPanel2);
getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame1().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JSplitPane jSplitPane1;
// End of variables declaration
}
Вы должны настроить setDividerLocation (n) на 1/3 ширины вашего JFrame.JSplitPane1.setEnabled (false) делает разделение фиксированным.