List of usage examples for javax.swing JScrollPane setOpaque
@BeanProperty(expert = true, description = "The component's opacity") public void setOpaque(boolean isOpaque)
From source file:es.emergya.ui.plugins.AdminPanel.java
/** * /*w w w. j a v a 2s.c o m*/ * @param columnNames * nombres de las columnas de la tabla * @param filterOptions * lista de opciones de un combobox. Si esta vacio entonces es un * textfield * @param noFiltrarAction * @param filtrarAction */ public void generateTable(String[] columnNames, Object[][] filterOptions, AdminPanel.NoFiltrarAction noFiltrarAction, AdminPanel.FiltrarAction filtrarAction) { if (columnNames == null) { columnNames = new String[] {}; } if (filterOptions == null) { filterOptions = new Object[][] {}; } String filterString = "["; for (Object[] o : filterOptions) { filterString += Arrays.toString(o) + " "; } filterString += "]"; log.debug("generateTable( columnNames = " + Arrays.toString(columnNames) + ", filterOptions = " + filterString + ")"); tablePanel.removeAll(); int columnNamesLength = columnNames.length; if (!getCanDelete()) columnNamesLength++; MyTableModel dataModel = new MyTableModel(1, columnNamesLength + 2) { private static final long serialVersionUID = 1348355328684460769L; @Override public boolean isCellEditable(int row, int column) { return column != 0 && !invisibleFilterCols.contains(column); } }; filters = new JTable(dataModel) { private static final long serialVersionUID = -8266991359840905405L; @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component c = super.prepareRenderer(renderer, row, column); if (isCellEditable(row, column) && column != getColumnCount() - 1) { if (c instanceof JTextField) { ((JTextField) c).setBorder(new MatteBorder(1, 1, 1, 1, Color.BLACK)); } else if (c instanceof JComboBox) { ((JComboBox) c).setBorder(new MatteBorder(1, 1, 1, 1, Color.BLACK)); } else if (c instanceof JLabel) { ((JLabel) c).setBorder(new MatteBorder(1, 1, 1, 1, Color.BLACK)); } } return c; } }; filters.setSurrendersFocusOnKeystroke(true); filters.setShowGrid(false); filters.setRowHeight(22); filters.setOpaque(false); for (Integer i = 0; i < filterOptions.length; i++) { final Object[] items = filterOptions[i]; if (items != null && items.length > 1) { setComboBoxEditor(i, items); } else { final DefaultCellEditor defaultCellEditor = new DefaultCellEditor(new JTextField()); defaultCellEditor.setClickCountToStart(1); filters.getColumnModel().getColumn(i + 1).setCellEditor(defaultCellEditor); } } filters.setRowSelectionAllowed(false); filters.setDragEnabled(false); filters.setColumnSelectionAllowed(false); filters.setDefaultEditor(JButton.class, new JButtonCellEditor()); filters.setDefaultRenderer(Object.class, new DefaultTableRenderer() { private static final long serialVersionUID = -4811729559786534118L; @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (invisibleFilterCols.contains(column)) c = new JLabel(""); return c; } }); filters.setDefaultRenderer(JButton.class, new TableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JButton b = (JButton) value; b.setBorderPainted(false); b.setContentAreaFilled(false); return b; } }); filters.setDefaultRenderer(JLabel.class, new TableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return (JLabel) value; } }); filters.setDefaultEditor(JButton.class, new JButtonCellEditor()); filters.getModel().setValueAt(new JLabel(""), 0, 0); JButton jButton2 = new JButton(noFiltrarAction); JButton jButton = new JButton(filtrarAction); jButton.setBorderPainted(false); jButton2.setBorderPainted(false); jButton.setContentAreaFilled(false); jButton2.setContentAreaFilled(false); if (jButton.getIcon() != null) jButton.setPreferredSize( new Dimension(jButton.getIcon().getIconWidth(), jButton.getIcon().getIconHeight())); if (jButton2.getIcon() != null) jButton2.setPreferredSize( new Dimension(jButton2.getIcon().getIconWidth(), jButton2.getIcon().getIconHeight())); filters.getModel().setValueAt(jButton, 0, columnNamesLength - 1); filters.getColumnModel().getColumn(columnNamesLength - 1).setMinWidth(jButton.getWidth() + 24); filters.getModel().setValueAt(jButton2, 0, columnNamesLength); filters.getColumnModel().getColumn(columnNamesLength).setMinWidth(jButton2.getWidth() + 14); cuenta.setHorizontalAlignment(JLabel.CENTER); cuenta.setText("?/?"); filters.getModel().setValueAt(cuenta, 0, columnNamesLength + 1); tablePanel.add(filters, BorderLayout.NORTH); Vector<String> headers = new Vector<String>(); headers.add(""); headers.addAll(Arrays.asList(columnNames)); MyTableModel model = new MyTableModel(headers, 0); table = new JTable(model) { private static final long serialVersionUID = 949284378605881770L; private int highLightedRow = -1; private Rectangle dirtyRegion = null; public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component c = super.prepareRenderer(renderer, row, column); try { if (AdminPanel.this.myRendererColoring != null) c.setBackground(AdminPanel.this.myRendererColoring .getColor(AdminPanel.this.table.getValueAt(row, 1))); } catch (Throwable t) { log.error("Error al colorear la celda: " + t); } return c; } @Override protected void processMouseMotionEvent(MouseEvent e) { try { int row = rowAtPoint(e.getPoint()); Graphics g = getGraphics(); if (row == -1) { highLightedRow = -1; } // row changed if (highLightedRow != row) { if (null != dirtyRegion) { paintImmediately(dirtyRegion); } for (int j = 0; j < getRowCount(); j++) { if (row == j) { // highlight Rectangle firstRowRect = getCellRect(row, 0, false); Rectangle lastRowRect = getCellRect(row, getColumnCount() - 1, false); dirtyRegion = firstRowRect.union(lastRowRect); g.setColor(new Color(0xff, 0xff, 0, 100)); g.fillRect((int) dirtyRegion.getX(), (int) dirtyRegion.getY(), (int) dirtyRegion.getWidth(), (int) dirtyRegion.getHeight()); highLightedRow = row; } } } } catch (Exception ex) { } super.processMouseMotionEvent(e); } }; table.setRowHeight(22); table.setOpaque(false); // table.setAutoCreateRowSorter(true); table.setDragEnabled(false); table.getTableHeader().setReorderingAllowed(false); table.getTableHeader().setResizingAllowed(false); table.setDefaultEditor(JButton.class, new JButtonCellEditor()); table.setDefaultRenderer(JButton.class, new TableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JButton b = (JButton) value; if (b != null) { b.setBorderPainted(false); b.setContentAreaFilled(false); } return b; } }); JScrollPane jScrollPane = new JScrollPane(table); jScrollPane.setOpaque(false); jScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); jScrollPane.getViewport().setOpaque(false); tablePanel.add(jScrollPane, BorderLayout.CENTER); }
From source file:edu.ku.brc.stats.StatGroupTable.java
/** * Constructor with the localized name of the Group * @param name name of the group (already been localized) * @param useSeparator use non-border separator titles *//*from w w w. j a v a2s . c o m*/ public StatGroupTable(final String name, final String[] columnNames, final boolean useSeparator, final int numRows) { this.name = name; this.useSeparator = useSeparator; this.skinItem = SkinsMgr.getSkinItem("StatGroup"); if (progressIcon == null) { progressIcon = IconManager.getIcon("Progress", IconManager.IconSize.Std16); } setLayout(new BorderLayout()); setBackground(Color.WHITE); model = new StatGroupTableModel(this, columnNames); //table = numRows > SCROLLPANE_THRESOLD ? (new SortableJTable(new SortableTableModel(model))) : (new JTable(model)); if (numRows > SCROLLPANE_THRESOLD) { table = new SortableJTable(new SortableTableModel(model)) { protected void configureEnclosingScrollPane() { Container p = getParent(); if (p instanceof JViewport) { Container gp = p.getParent(); if (gp instanceof JScrollPane) { JScrollPane scrollPane = (JScrollPane) gp; // Make certain we are the viewPort's view and not, for // example, the rowHeaderView of the scrollPane - // an implementor of fixed columns might do this. JViewport viewport = scrollPane.getViewport(); if (viewport == null || viewport.getView() != this) { return; } // scrollPane.setColumnHeaderView(getTableHeader()); //scrollPane.getViewport().setBackingStoreEnabled(true); scrollPane.setBorder(UIManager.getBorder("Table.scrollPaneBorder")); } } } }; } else { table = new JTable(model) { protected void configureEnclosingScrollPane() { Container p = getParent(); if (p instanceof JViewport) { Container gp = p.getParent(); if (gp instanceof JScrollPane) { JScrollPane scrollPane = (JScrollPane) gp; // Make certain we are the viewPort's view and not, for // example, the rowHeaderView of the scrollPane - // an implementor of fixed columns might do this. JViewport viewport = scrollPane.getViewport(); if (viewport == null || viewport.getView() != this) { return; } // scrollPane.setColumnHeaderView(getTableHeader()); //scrollPane.getViewport().setBackingStoreEnabled(true); scrollPane.setBorder(UIManager.getBorder("Table.scrollPaneBorder")); } } } }; } table.setShowVerticalLines(false); table.setShowHorizontalLines(false); if (SkinsMgr.shouldBeOpaque(skinItem)) { table.setOpaque(false); setOpaque(false); } else { table.setOpaque(true); setOpaque(true); } table.addMouseMotionListener(new TableMouseMotion()); table.addMouseListener(new LinkListener()); if (table.getColumnModel().getColumnCount() == 1) { table.getColumnModel().getColumn(0) .setCellRenderer(new StatGroupTableCellRenderer(SwingConstants.CENTER, 1)); } else { table.getColumnModel().getColumn(0) .setCellRenderer(new StatGroupTableCellRenderer(SwingConstants.LEFT, 2)); table.getColumnModel().getColumn(1) .setCellRenderer(new StatGroupTableCellRenderer(SwingConstants.RIGHT, 2)); } //table.setRowSelectionAllowed(true); if (numRows > SCROLLPANE_THRESOLD) { scrollPane = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); if (table instanceof SortableJTable) { ((SortableJTable) table).installColumnHeaderListeners(); } scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(BorderFactory.createEmptyBorder()); //scrollPane.getViewport().setBorder(BorderFactory.createEmptyBorder()); } if (useSeparator) { setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); CellConstraints cc = new CellConstraints(); if (StringUtils.isNotEmpty(name)) { builder.addSeparator(name, cc.xy(1, 1)); } builder.add(scrollPane != null ? scrollPane : table, cc.xy(1, 2)); builder.getPanel().setOpaque(false); add(builder.getPanel()); } else { setBorder(BorderFactory.createEmptyBorder(15, 2, 2, 2)); setBorder(BorderFactory.createCompoundBorder(new CurvedBorder(new Color(160, 160, 160)), getBorder())); add(scrollPane != null ? scrollPane : table, BorderLayout.CENTER); } }
From source file:edu.ku.brc.af.ui.forms.FormViewObj.java
/** * Sets the component into the object//from ww w .jav a 2s. com * @param formComp the UI component that represents this viewable */ public void setFormComp(final JComponent formComp) { // Remove existing component if (this.formComp != null) { mainComp.remove(this.formComp); } // add new component if (MultiView.isOptionOn(options, MultiView.NO_SCROLLBARS)) { if (ViewFactory.isFormTransparent()) { formComp.setOpaque(false); } this.mainComp.add(formComp, BorderLayout.CENTER); this.formComp = formComp; } else { JScrollPane scrollPane = new JScrollPane(formComp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.getVerticalScrollBar().setUnitIncrement(10); scrollPane.setBorder(null); this.mainComp.add(scrollPane, BorderLayout.CENTER); this.formComp = scrollPane; if (ViewFactory.isFormTransparent()) { scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); } } if (businessRules != null && !hasInitBR) { businessRules.initialize(this); hasInitBR = true; } // This is needed to make the form layout correctly //XXX I hate that I have to do this SwingUtilities.invokeLater(new Runnable() { public void run() { //mainComp.invalidate(); //mainComp.validate(); //mainComp.doLayout(); UIRegistry.forceTopFrameRepaint(); } }); }
From source file:org.dishevelled.brainstorm.BrainStorm.java
/** * Layout components./*from w ww. ja v a2 s .com*/ */ private void layoutComponents() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setBorder(null); scrollPane.setOpaque(true); scrollPane.setBackground(backgroundColor); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); add(placeholder); JPanel flow = new JPanel(); flow.setLayout(new FlowLayout()); flow.setOpaque(false); flow.add(scrollPane); add(flow); add(Box.createVerticalGlue()); add(Box.createVerticalGlue()); }
From source file:org.isatools.gui.datamanager.exportisa.ExportISAGUI.java
public void createGUI() { // header image add(UIHelper.wrapComponentInPanel(new JLabel(panelHeader, SwingConstants.RIGHT)), BorderLayout.NORTH); // add a checkable jtree with investigations & studies... JPanel availableSubmissionsContainer = new JPanel(new BorderLayout()); availableSubmissionsContainer.setOpaque(false); JPanel optionsContainer = new JPanel(); optionsContainer.setLayout(new BoxLayout(optionsContainer, BoxLayout.LINE_AXIS)); optionsContainer.setOpaque(false);/*from www .j a va2s .c om*/ JPanel optionsAndInformationPanel = new JPanel(); optionsAndInformationPanel.setLayout(new BoxLayout(optionsAndInformationPanel, BoxLayout.PAGE_AXIS)); optionsAndInformationPanel.setOpaque(false); JLabel fileInformation = UIHelper.createLabel("<html><i>where</i> to save the isatab files?</html>", UIHelper.VER_12_BOLD, UIHelper.LIGHT_GREY_COLOR); fileInformation.setVerticalAlignment(JLabel.TOP); JPanel fileLocationOptionContainer = new JPanel(); fileLocationOptionContainer.setLayout(new BoxLayout(fileLocationOptionContainer, BoxLayout.PAGE_AXIS)); fileLocationOptionContainer.setOpaque(false); // add component for selection of output to repository or output to folder... fileLocationOptionGroup = new OptionGroup<String>(OptionGroup.HORIZONTAL_ALIGNMENT, true); fileLocationOptionGroup.addOptionItem("BII repository", true); fileLocationOptionGroup.addOptionItem("Local file system"); localDirectoryLocation = new FileSelectionUtil("select output directory", createFileChooser(), UIHelper.VER_11_BOLD, UIHelper.GREY_COLOR); localDirectoryLocation.setVisible(false); localDirectoryLocation.setPreferredSize(new Dimension(150, 20)); fileLocationOptionGroup.addPropertyChangeListener("optionSelectionChange", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent propertyChangeEvent) { localDirectoryLocation .setVisible(fileLocationOptionGroup.getSelectedItem().equals("Local file system")); revalidate(); } }); fileLocationOptionContainer.add(UIHelper.wrapComponentInPanel(fileInformation)); fileLocationOptionContainer.add(UIHelper.wrapComponentInPanel(fileLocationOptionGroup)); fileLocationOptionContainer.add(Box.createVerticalStrut(5)); fileLocationOptionContainer.add(UIHelper.wrapComponentInPanel(localDirectoryLocation)); optionsContainer.add(fileLocationOptionContainer); JPanel dataFileExportOptionContainer = new JPanel(); dataFileExportOptionContainer.setLayout(new BoxLayout(dataFileExportOptionContainer, BoxLayout.PAGE_AXIS)); dataFileExportOptionContainer.setOpaque(false); JLabel dataFileExportInformation = UIHelper.createLabel("<html>export data files?</html>", UIHelper.VER_12_BOLD, UIHelper.LIGHT_GREY_COLOR); dataFileExportInformation.setVerticalAlignment(JLabel.TOP); dataFileExportOptionGroup = new OptionGroup<String>(OptionGroup.HORIZONTAL_ALIGNMENT, true); dataFileExportOptionGroup.addOptionItem("yes", true); dataFileExportOptionGroup.addOptionItem("no"); dataFileExportOptionContainer.add(UIHelper.wrapComponentInPanel(dataFileExportInformation)); dataFileExportOptionContainer.add(UIHelper.wrapComponentInPanel(dataFileExportOptionGroup)); dataFileExportOptionContainer.add(Box.createVerticalStrut(25)); optionsContainer.add(dataFileExportOptionContainer); optionsAndInformationPanel.add(Box.createVerticalStrut(5)); optionsAndInformationPanel.add(optionsContainer); optionsAndInformationPanel.add(Box.createVerticalStrut(10)); JLabel information = UIHelper.createLabel( "<html>please <i>select</i> the submissions to be exported...</html>", UIHelper.VER_12_BOLD, UIHelper.LIGHT_GREY_COLOR); information.setVerticalAlignment(JLabel.TOP); optionsAndInformationPanel.add(UIHelper.wrapComponentInPanel(information)); optionsAndInformationPanel.add(Box.createVerticalStrut(5)); availableSubmissionsContainer.add(optionsAndInformationPanel, BorderLayout.NORTH); retrieveAndProcessStudyInformation(); JScrollPane treeScroller = new JScrollPane(studyAvailabilityTree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); treeScroller.getViewport().setOpaque(false); treeScroller.setOpaque(false); treeScroller.setBorder(new EmptyBorder(1, 1, 1, 1)); treeScroller.setPreferredSize(new Dimension(380, 250)); availableSubmissionsContainer.add(treeScroller, BorderLayout.CENTER); add(availableSubmissionsContainer, BorderLayout.CENTER); add(createSouthPanel(), BorderLayout.SOUTH); }
From source file:org.isatools.gui.datamanager.studyaccess.StudyAccessionGUI.java
private JPanel createStudySelectionPanel() { JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.PAGE_AXIS)); container.setOpaque(false);//from w w w . j av a 2 s. c om JPanel studyAccessionSelector = new JPanel(); studyAccessionSelector.setLayout(new BorderLayout()); studyAccessionSelector.setOpaque(false); JLabel information = new JLabel(unloadStudyHeader); information.setHorizontalAlignment(SwingConstants.RIGHT); information.setVerticalAlignment(SwingConstants.TOP); studyAccessionSelector.add(information, BorderLayout.NORTH); retrieveAndProcessStudyInformation(); JScrollPane treeScroller = new JScrollPane(studyAvailabilityTree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); treeScroller.getViewport().setOpaque(false); treeScroller.setOpaque(false); treeScroller.setBorder(new EmptyBorder(1, 1, 1, 1)); treeScroller.setPreferredSize(new Dimension(380, 210)); studyAccessionSelector.add(treeScroller); container.add(studyAccessionSelector); // and need a convert button! JPanel buttonCont = new JPanel(new BorderLayout()); buttonCont.setOpaque(false); final JLabel unload = new JLabel(this.unloadButton, JLabel.RIGHT); unload.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent mouseEvent) { unload.setIcon(unloadButtonOver); } public void mouseExited(MouseEvent mouseEvent) { unload.setIcon(StudyAccessionGUI.this.unloadButton); } public void mousePressed(MouseEvent mouseEvent) { Set<String> studiesToUnload = studyAvailabilityTree .getCheckedStudies(studyAvailabilityTree.getRoot()); log.info("going to unload: "); for (String acc : studiesToUnload) { log.info("study with acc " + acc); } doUnloading(studiesToUnload); } }); buttonCont.add(unload, BorderLayout.EAST); buttonCont.add(createBackToMainMenuButton(), BorderLayout.WEST); container.add(buttonCont); return container; }
From source file:org.jimcat.gui.perspective.detail.DetailSideBar.java
/** * creates image Detail - Section//from w w w .ja v a 2 s. c om * * @return the Component used to show details */ private JComponent createImageDetail() { JLabel tmp = null; // Task Panel JXTaskPaneContainer container = new JXTaskPaneContainer(); container.setOpaque(false); // General Infos JXTaskPane general = new JXTaskPane(); general.setOpaque(true); general.setTitle("General Info"); general.setExpanded(true); // General info list JPanel info = new JPanel(); GridLayout infoLayout = new GridLayout(0, 2); infoLayout.setHgap(5); info.setLayout(infoLayout); info.setOpaque(false); tmp = new JLabel("Title"); tmp.setFont(labelFont); info.add(tmp); info.add(title); tmp = new JLabel("Rating"); tmp.setFont(labelFont); info.add(tmp); rating = new RatingEditor(); info.add(rating); tmp = new JLabel("Dimension"); tmp.setFont(labelFont); info.add(tmp); dimension = new JLabel(""); info.add(dimension); tmp = new JLabel("Size"); tmp.setFont(labelFont); info.add(tmp); size = new JLabel(""); info.add(size); tmp = new JLabel("Location"); tmp.setFont(labelFont); info.add(tmp); path = new JLabel(""); path.setToolTipText(""); info.add(path); general.add(info); container.add(general); // Exif data JXTaskPane exifs = new JXTaskPane(); exifs.setOpaque(true); exifs.setTitle("Exif Infos"); exifs.setExpanded(true); exifList = new ExifList(); exifs.add(exifList); container.add(exifs); // Tags JXTaskPane tags = new JXTaskPane(); tags.setOpaque(true); tags.setTitle("Associated Tags"); tags.setExpanded(true); // associated tags-list detailTagList = new DetailTagList(); tags.add(detailTagList); container.add(tags); // Modify Tags JXTaskPane filter = new JXTaskPane(); filter.setTitle("Modify Tags"); filter.setExpanded(false); filter.setOpaque(true); tagTree = new TagTree(); tagTree.addTagTreeListener(this); filter.setLayout(new BorderLayout()); filter.addMouseListener(new TagPanelPopupHandler(filter)); filter.add(tagTree, BorderLayout.CENTER); container.add(filter); JScrollPane pane = new JScrollPane(); pane.setOpaque(true); pane.setBorder(null); pane.setViewportView(container); pane.putClientProperty(SubstanceLookAndFeel.WATERMARK_TO_BLEED, Boolean.TRUE); return pane; }
From source file:org.openconcerto.erp.core.finance.accounting.ui.EtatJournauxPanel.java
public void loadAsynchronous() { // On recupere les differents journaux SQLTable journalTable = base.getTable("JOURNAL"); List<SQLRow> liste = SQLBackgroundTableCache.getInstance().getCacheForTable(journalTable).getRows(); for (int k = 0; k < liste.size(); k++) { SQLRow row = liste.get(k);//from w w w.j av a 2 s. co m fireIsLoading(true); final Journal jrnlTmp = new Journal(row.getID(), row.getString("NOM"), row.getString("CODE")); new SwingWorker<JPanel, Object>() { @Override protected JPanel doInBackground() throws Exception { final JPanel initJournalPanel = initJournalPanel(jrnlTmp); return initJournalPanel; } @Override protected void done() { JPanel initJournalPanel; try { initJournalPanel = get(); initJournalPanel.setOpaque(false); JScrollPane scroll = new JScrollPane(initJournalPanel); scroll.setBorder(null); scroll.setOpaque(false); scroll.getViewport().setOpaque(false); EtatJournauxPanel.this.tabbedJournaux.addTab(jrnlTmp.getNom(), scroll); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ExecutionException e) { // TODO Auto-generated catch block e.printStackTrace(); } fireIsLoading(false); super.done(); } }.execute(); } }
From source file:org.openconcerto.erp.core.finance.accounting.ui.GrandLivrePanel.java
public void loadAsynchronous() { // On recupere les differentes classes List<ClasseCompte> liste = ClasseCompte.getClasseCompte(); if (liste.size() != 0) { for (int k = 0; k < liste.size(); k++) { final ClasseCompte ccTmp = liste.get(k); fireLoading(true);//from ww w. j a v a2 s .com new SwingWorker<JPanel, Object>() { @Override protected JPanel doInBackground() throws Exception { // TODO Auto-generated method stub return initClassePanel(ccTmp); } @Override protected void done() { JPanel initClassePanel; try { initClassePanel = get(); initClassePanel.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(initClassePanel); scrollPane.setOpaque(false); scrollPane.setBorder(null); scrollPane.getViewport().setOpaque(false); // On crer les comptes de chaque classe GrandLivrePanel.this.tabbedClasse.addTab(ccTmp.getNom(), scrollPane); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ExecutionException e) { // TODO Auto-generated catch block e.printStackTrace(); } fireLoading(false); super.done(); } }.execute(); } } }
From source file:org.openmicroscopy.shoola.agents.fsimporter.view.ImporterUIElement.java
/** Builds and lays out the UI. */ private void buildGUI() { layoutEntries(false);//w w w . j ava 2 s .c om JScrollPane pane = new JScrollPane(entries); pane.setOpaque(false); pane.setBorder(new LineBorder(Color.LIGHT_GRAY)); setLayout(new BorderLayout(0, 0)); add(buildHeader(), BorderLayout.NORTH); add(pane, BorderLayout.CENTER); }