다음 스윙 레이아웃이 내 수업 중 하나에 정의되어 있으며 어떤 일이 벌어지고 있는지 감출 수 없습니다.Java : 양식 레이아웃 매개 변수 설명
private void initComponents()
{
locationPanel = new JPanel();
label1 = new JLabel();
lastUpdateLabel = new JLabel();
label2 = new JLabel();
accuracyLabel = new JLabel();
batteryPanel = new JPanel();
batteryLabel = new JLabel();
label3 = new JLabel();
cc = new CellConstraints();
setLayout(new FormLayout("default", "default"));
locationPanel.setBorder(new TitledBorder("Info"));
locationPanel.setLayout(new FormLayout("right:pref, 6dlu, 50dlu, 4dlu, default", "pref, 3dlu, pref, 3dlu, pref"));
label1.setText("Last Update:");
locationPanel.add(label1, cc.xy(1, 1));
lastUpdateLabel.setText("Unknown");
locationPanel.add(lastUpdateLabel, cc.xy(3, 1));
label2.setText("Accuracy:");
locationPanel.add(label2, cc.xy(1, 3));
// ---- accuracyLabel ----
accuracyLabel.setText("Unknown");
locationPanel.add(accuracyLabel, cc.xy(3, 3));
label3.setText("Battery Level");
locationPanel.add(label3, cc.xy(1, 5));
batteryLabel.setText("Unknown");
locationPanel.add(batteryLabel, cc.xy(3, 5));
add(locationPanel, cc.xy(1, 1));
}
질문 : 내가 생각하는 그것의 3 행과 2 열이 있어야 말? 정의 된 행 및 열 수; 어떻게하면 4x2 레이아웃을 만들 수 있습니까? 나는이locationPanel.setLayout(new FormLayout("right:pref, 6dlu, 50dlu, 4dlu, default", "pref, 3dlu, pref, 3dlu, pref"));
무엇이 당신의 질문입니까? –
@ AleksanderBlomskøld 편집 된 질문 – stackoverflow
[documentation] (http://www.formdev.com/jformdesigner/doc/layouts/formlayout/)을 읽는 것은 어떻습니까? –