私はJavaでチェッカーボードに取り組んでいます。しかし、私には奇妙な問題があります。vgap を 0 に設定しても vgap が作成されます。高さの正方形の間に約 5px のスペースがあります。幅はまあまあ。これは、ダイアグラム オブジェクトの私のレイアウト コードです。
this.setLayout(new GridLayout(10, 10, 0, 0));
this.setPreferredSize(new Dimension(230, 230));
そして、これは私がダイアグラムを実装する場所です:
// The jpanel that has to contain the diagram
jpanel.setLayout(new FlowLayout());
add(jpanel, BorderLayout.WEST);
// The placement of the diagram in that jpanel
jp.add(new diagram());
これはどのように見えるかです:
[][][][][][][][][]
<The spacing that I have to get removed>
[][][][][][][][][]
しかし、次のようにする必要があります。
[][][][][][][][][]
[][][][][][][][][]
^
|
no spacing between them