誰かが助けてくれることを願っていました。これは簡単な問題のように思えますが、私の人生では解決できません。
問題:JPanel
それぞれに が付いた 5 つのラベルを含むパネルで構成される を作成していImageIcons
ます。[ややこしいですね]
次に、このパネルを に追加していJScrollPane
ます。しかし、表示されると画像が表示され、正しく配置されますが、下にスクロールして画面から外れているパネルを見ることができません。
ここにスクリーンショットがあります: http://img841.imageshack.us/img841/36/screenshot20120510at160.png
これは、パネルにデータを入力してJScrollPane
.
private void setSeriesViewContainer(){
container = new BackgroundPanel(backGround, BackgroundPanel.TILED);
//container.setPreferredSize(new Dimension(650,500));
container.setLayout(new BoxLayout(container, BoxLayout.PAGE_AXIS));
FlowLayout flowLayout = new FlowLayout();
JPanel[] jp = new BackgroundPanel[10];
for (int i = 0; i < jp.length; i++) {
jp[i] = new BackgroundPanel(backGround, BackgroundPanel.TILED);
jp[i].setLayout(flowLayout);
for (int j = 0; j < 10; j++) {
jp[i].add(new JLabel(new ImageIcon(getClass().getResource("/placeHolder.png"))));
}
}
for (int i = 0; i < jp.length; i++) {
container.add(jp[i]);
}
public void init(){
seriesViewContainer = new javax.swing.JScrollPane(container);
seriesViewContainer.setBorder(null);
seriesViewContainer.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
seriesViewContainer.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
seriesViewContainer.setPreferredSize(new java.awt.Dimension(700, 300));}
私は解決策を探し回っていますが、まだ解決していません。