刷新jscroll窗格中的数据

时间:2013-09-16 11:48:09

标签: java swing

我有一个主面板,其中有另一个面板,我正在应用滚动。这个面板又包含2个面板。

现在,当我应用滚动时,会出现滚动条。

问题是当我从用户屏幕部分动态添加数据时......数据显示在屏幕上但我无法向下滚动面板并且滚动条下方的数据看不清楚。< / p>

generalInformationPanel = new JPanel(new GridLayout(1, 1));
generalInformationPanel.setBounds(0, 0, 1050, 500);
generalInformationPanel.setBackground(Color.WHITE);

gd_GeneralInformationUpperPanel = new JPanel();
gd_GeneralInformationUpperPanel.setBounds(0, 0, 1050, 700);
gd_GeneralInformationUpperPanel.setLayout(null);
gd_GeneralInformationUpperPanel.setBackground(Color.WHITE);
js1 = new JScrollPane(gd_GeneralInformationUpperPanel,
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
js1.setBounds(0, 0, 950, 450);
js1.setVisible(true);
generalInformationPanel.add(js1);

add(generalInformationPanel, BorderLayout.CENTER);

0 个答案:

没有答案
相关问题