Проблема во время создания запаса JPanelJAVA

Программисты JAVA общаются здесь
Anonymous
Проблема во время создания запаса JPanel

Сообщение Anonymous »

Я пытаюсь создать jpanel , который находится в gridlayout ряд jlabel s в левый jtextfield s справа. К сожалению, ничего не показано, даже если компонент s сообщается о правильно добавленной. Где проблема? < /P> public class AlternateGL_JPanel extends JPanel {
protected JPanel layoutPanel;
protected int rows, columns;

public AlternateGL_JPanel(int rows, int columns) {
this.rows = rows;
this.columns = columns;

// ===== MAIN FRAME DEFINITION =====
setBorder(new EmptyBorder(0, 0, 0, 0));
setLayout(new GridLayout(this.rows, this.columns));
// setBounds(10, 10, 500, 500);

// ===== INNER PANEL =====
this.layoutPanel = new JPanel(); //This is the nested panel
layoutPanel.setLayout(new GridLayout(this.rows, this.columns));
super.add(layoutPanel, BorderLayout.PAGE_START);
}
// =========================================================
// TODO | Superclass: JPanel

public void add(JComponent component) {
layoutPanel.add(component);
}

}

/** A ManyTextAndInsertText
is a {@link JPanel} that houses a number of {@link JLabel}s to the left
* and {@link JTextField}s on the right.
*
*/
public class ManyTextAndInsertText extends AlternateGL_JPanel {
private JLabel[] texts;
private JTextField[] insertTexts;

public ManyTextAndInsertText(String[] descriptions) {
super(descriptions.length, 2);

this.texts = new JLabel[descriptions.length];
this.insertTexts = new JTextField[descriptions.length];

for(int i=0 ; i

Подробнее здесь: https://stackoverflow.com/questions/641 ... ock-jpanel

Вернуться в «JAVA»