public void resize() { Component[] comps = feedPanel.getComponents(); for (int i = 0; i < comps.length; i++) { Component component = comps[i]; if (component instanceof FeedPanel) { FeedPanel fp = (FeedPanel) component; fp.resize(FeedPanel.MINIMIZED); } } }
public void setFeed(Feed feed) { MySeriesLogger.logger.log(Level.INFO, "Setting feed to {0}", feed); this.feed = feed; removeAll(); feedPanel = new MyScrollableFlowPanel(); JScrollPane panel = new JScrollPane(feedPanel); panel.getViewport().setOpaque(false); panel.setOpaque(false); feedPanel.setOpaque(false); panel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(panel, BorderLayout.CENTER); feedPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); int count = 0; MySeriesLogger.logger.log(Level.INFO, "Creating {0} feed entries", feed.getEntries().size()); for (Iterator<SyndEntryImpl> it = feed.getEntries().iterator(); it.hasNext(); ) { SyndEntryImpl entry = it.next(); FeedPanel p = new FeedPanel(feedPanel, entry, this); p.run(); count++; } revalidate(); repaint(); }