当前位置: 首页>>代码示例>>Java>>正文


Java JScrollPane.setBackground方法代码示例

本文整理汇总了Java中javax.swing.JScrollPane.setBackground方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setBackground方法的具体用法?Java JScrollPane.setBackground怎么用?Java JScrollPane.setBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.setBackground方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: erzeugeVerleihkartenauflister

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Erzeuge das Tabellen-Panel, in dem die Verleihkarten angezeigt werden.
 */
private void erzeugeVerleihkartenauflister()
{
    JPanel verleihkartenAuflisterPanel = new JPanel();
    _hauptPanel.add(verleihkartenAuflisterPanel, BorderLayout.CENTER);
    verleihkartenAuflisterPanel.setLayout(new BorderLayout());
    verleihkartenAuflisterPanel
        .setPreferredSize(new java.awt.Dimension(-1, -1));
    verleihkartenAuflisterPanel.setSize(-1, -1);
    verleihkartenAuflisterPanel.setBackground(UIConstants.BACKGROUND_COLOR);

    JScrollPane verleihkartenAuflisterScrollPane = new JScrollPane();
    verleihkartenAuflisterPanel.add(verleihkartenAuflisterScrollPane,
            BorderLayout.CENTER);
    verleihkartenAuflisterScrollPane
        .setPreferredSize(new java.awt.Dimension(-1, -1));
    verleihkartenAuflisterScrollPane.setSize(-1, -1);
    verleihkartenAuflisterScrollPane.setBorder(BorderFactory
        .createTitledBorder(null, "Verleihkarten", TitledBorder.LEADING,
                TitledBorder.DEFAULT_POSITION, UIConstants.HEADER_FONT));
    verleihkartenAuflisterScrollPane
        .setBackground(UIConstants.BACKGROUND_COLOR);
    verleihkartenAuflisterScrollPane.getVerticalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);
    verleihkartenAuflisterScrollPane.getHorizontalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);

    _verleihkartenAuflisterTableModel = new VerleihkartenTableModel();
    _verleihkartenAuflisterTable = new JTable();
    verleihkartenAuflisterScrollPane
        .setViewportView(_verleihkartenAuflisterTable);
    _verleihkartenAuflisterTable
        .setModel(_verleihkartenAuflisterTableModel);
    JTableHeader tableHeader = _verleihkartenAuflisterTable
        .getTableHeader();
    tableHeader.setFont(UIConstants.HEADER_FONT);
    tableHeader.setReorderingAllowed(false);
    tableHeader.setResizingAllowed(false);
    _verleihkartenAuflisterTable.setFont(UIConstants.TEXT_FONT);
}
 
开发者ID:polemonium,项目名称:SE2Project,代码行数:43,代码来源:RueckgabeUI.java

示例2: erzeugeVerleihkartenAnzeiger

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Erzeuge das Zusammenfassung-Panel, in dem die ausgewählten Verleihkarten
 * im Detail angezeigt werden.
 */
private void erzeugeVerleihkartenAnzeiger()
{
    JPanel verleihkartenAnzeigerPanel = new JPanel();
    BorderLayout detailsPanelLayout = new BorderLayout();
    _ruecknahmePanel.add(verleihkartenAnzeigerPanel, BorderLayout.CENTER);
    verleihkartenAnzeigerPanel.setLayout(detailsPanelLayout);
    verleihkartenAnzeigerPanel
        .setPreferredSize(new java.awt.Dimension(-1, -1));
    verleihkartenAnzeigerPanel.setSize(-1, -1);
    verleihkartenAnzeigerPanel.setBackground(UIConstants.BACKGROUND_COLOR);

    JScrollPane verleihkartenAnzeigerScrollPane = new JScrollPane();
    verleihkartenAnzeigerPanel.add(verleihkartenAnzeigerScrollPane,
            BorderLayout.CENTER);
    verleihkartenAnzeigerScrollPane
        .setPreferredSize(new java.awt.Dimension(-1, -1));
    verleihkartenAnzeigerScrollPane
        .setBorder(BorderFactory.createTitledBorder(null,
                "Ausgewählte Verleihkarten", TitledBorder.LEADING,
                TitledBorder.DEFAULT_POSITION, UIConstants.HEADER_FONT));
    verleihkartenAnzeigerScrollPane.setSize(-1, -1);
    verleihkartenAnzeigerScrollPane
        .setBackground(UIConstants.BACKGROUND_COLOR);
    verleihkartenAnzeigerScrollPane.getVerticalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);
    verleihkartenAnzeigerScrollPane.getHorizontalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);

    _verleihkartenAnzeigerTextArea = new JTextArea();
    _verleihkartenAnzeigerTextArea
        .setBackground(UIConstants.BACKGROUND_COLOR);
    verleihkartenAnzeigerScrollPane
        .setViewportView(_verleihkartenAnzeigerTextArea);
    _verleihkartenAnzeigerTextArea.setEditable(false);
    _verleihkartenAnzeigerTextArea.setFont(UIConstants.TEXT_FONT);
}
 
开发者ID:polemonium,项目名称:SE2Project,代码行数:41,代码来源:RueckgabeUI.java

示例3: getVisualizationComponent

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	TableModel tableModel = getTableModel(renderable, ioContainer, false);
	if (tableModel != null) {
		ExtendedJTable table = new ExtendedJTable(getTableModel(renderable, ioContainer, false), isSortable(),
				isColumnMovable(), isAutoresize());
		table.setRowHighlighting(true);
		table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
		table.getTableHeader().putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
		((TableHeaderUI) table.getTableHeader().getUI()).installDefaults();

		JScrollPane sp = new ExtendedJScrollPane(table);
		sp.setBorder(BorderFactory.createEmptyBorder(42, 10, 10, 10));
		sp.setBackground(Colors.WHITE);
		sp.getViewport().setBackground(Colors.WHITE);

		JPanel panel = new JPanel(new BorderLayout());
		panel.add(sp, BorderLayout.CENTER);
		return panel;
	} else {
		return ResultDisplayTools.createErrorComponent("No visualization possible for table.");
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:AbstractTableModelTableRenderer.java

示例4: makeMainLabel

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Creates the main text representation of this result.
 *
 * @param text
 * @return
 */
private Component makeMainLabel(String text) {
	JEditorPane label = new ExtendedHTMLJEditorPane("text/html", text);
	StyleSheet css = ((HTMLEditorKit) label.getEditorKit()).getStyleSheet();
	css.addRule("body {font-family:Sans;font-size:11pt}");
	css.addRule("h3 {margin:0; padding:0}");
	css.addRule("h4 {margin-bottom:0; margin-top:1ex; padding:0}");
	css.addRule("p  {margin-top:0; margin-bottom:1ex; padding:0}");
	css.addRule("ul {margin-top:0; margin-bottom:1ex; list-style-image: url("
			+ getClass().getResource("/com/rapidminer/resources/icons/modern/help/circle.png") + ")}");
	css.addRule("ul li {padding-bottom: 2px}");
	css.addRule("li.outPorts {padding-bottom: 0px}");
	css.addRule("ul li ul {margin-top:0; margin-bottom:1ex; list-style-image: url("
			+ getClass().getResource("/com/rapidminer/resources/icons/modern/help/line.png") + ")");
	css.addRule("li ul li {padding-bottom:0}");

	label.setEditable(false);

	JScrollPane pane = new JScrollPane(label);
	pane.setOpaque(false);
	pane.setBackground(null);
	pane.setBorder(null);
	return pane;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:30,代码来源:SingleResultOverview.java

示例5: initComponents

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                String urlString = url.toString();

                if (START_LOCATION_URLMASK.equals(urlString)) {
                    Utils.openLocation(StopwatchProfilingPoint.this.getStartLocation());
                } else if (StopwatchProfilingPoint.this.usesEndLocation()) {
                    Utils.openLocation(StopwatchProfilingPoint.this.getEndLocation());
                }
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea();

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.StopwatchProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:StopwatchProfilingPoint.java

示例6: initComponents

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                Utils.openLocation(ResetResultsProfilingPoint.this.getLocation());
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea();

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.ResetResultsProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:ResetResultsProfilingPoint.java

示例7: makeTableForToolTip

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public static Component makeTableForToolTip(ExampleSetMetaData emd) {
	ExtendedJTable table = new ExtendedJTable(new ExampleSetMetaDataTableModel(emd), true, true, true, false, false);
	JScrollPane scrollPane = new JScrollPane(table);
	scrollPane.setBorder(null);
	scrollPane.setPreferredSize(new Dimension(300, 200));
	scrollPane.setBackground(Colors.WHITE);
	scrollPane.getViewport().setBackground(Colors.WHITE);
	return scrollPane;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:ExampleSetMetaDataTableModel.java

示例8: ANOVAMatrixViewer

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public ANOVAMatrixViewer(ANOVAMatrix matrix) {
	super(new BorderLayout());

	JPanel panel = new JPanel(new GridBagLayout());
	panel.setOpaque(true);
	panel.setBackground(Colors.WHITE);

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 1.0;
	gbc.weighty = 1.0;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(42, 10, 20, 10);

	// table
	ANOVAMatrixViewerTable table = new ANOVAMatrixViewerTable(matrix);
	table.getTableHeader().putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
	((TableHeaderUI) table.getTableHeader().getUI()).installDefaults();
	table.setRowHighlighting(true);
	table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);

	JScrollPane scrollPane = new ExtendedJScrollPane(table);
	scrollPane.setBorder(null);
	scrollPane.setBackground(Colors.WHITE);
	scrollPane.getViewport().setBackground(Colors.WHITE);
	panel.add(scrollPane, gbc);

	// info string
	JLabel infoText = new JLabel();
	infoText.setText("A colored background indicates that the probability for non-difference between the groups is less than "
			+ Tools.formatNumber(matrix.getSignificanceLevel()));
	gbc.gridy += 1;
	gbc.insets = new Insets(5, 10, 5, 10);
	gbc.weighty = 0.0;
	gbc.fill = GridBagConstraints.HORIZONTAL;
	panel.add(infoText, gbc);

	add(panel, BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:41,代码来源:ANOVAMatrixViewer.java

示例9: Window

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public Window(){
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	KeyboardListener keyboardListener = new KeyboardListener(this);
	addKeyListener(keyboardListener);
	addFocusListener(keyboardListener);
	setFocusTraversalKeysEnabled(false); //Enables tab clicks to be sent o the keyboard listener
	
	setPreferredSize(new Dimension(900,500));
	
	textArea = new TextArea();
	
	
	JPanel resizer = new JPanel();
	resizer.setBackground(Color.WHITE);
	resizer.setLayout(new FlowLayout(FlowLayout.LEFT));
	resizer.add(textArea);
	
	JScrollPane scroller = new JScrollPane(resizer);
	scroller.setBackground(Color.WHITE);
	scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	add(scroller);
	pack();
	setVisible(true);
	textArea.defaultFocus();
	updateFocusTracker();
}
 
开发者ID:Emoun,项目名称:racp,代码行数:28,代码来源:Window.java

示例10: erzeugeMedienTable

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Erzeugt die Tabelle für die Anzeige der Medien.
 */
private void erzeugeMedienTable()
{
    JScrollPane medienAuflisterScrollPane = new JScrollPane();
    medienAuflisterScrollPane.setBorder(BorderFactory.createTitledBorder(
            null, "Medien", TitledBorder.LEADING,
            TitledBorder.DEFAULT_POSITION, UIConstants.HEADER_FONT));
    medienAuflisterScrollPane.setBackground(UIConstants.BACKGROUND_COLOR);
    medienAuflisterScrollPane.getVerticalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);
    medienAuflisterScrollPane.getHorizontalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);

    _ausleiheMedienTableModel = new AusleiheMedienTableModel();
    _medienTable = new JTable();
    medienAuflisterScrollPane.setViewportView(_medienTable);
    _medienTable.setModel(_ausleiheMedienTableModel);
    JTableHeader tableHeader = _medienTable.getTableHeader();
    tableHeader.setFont(UIConstants.HEADER_FONT);
    tableHeader.setReorderingAllowed(false);
    tableHeader.setResizingAllowed(false);
    _medienTable.setFont(UIConstants.TEXT_FONT);
    // Text in der 3. Spalte mittig ausrichten
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setHorizontalAlignment(JLabel.CENTER);
    String columnName = _medienTable.getColumnName(2);
    TableColumn column = _medienTable.getColumn(columnName);
    column.setCellRenderer(renderer);

    _hauptPanel.add(medienAuflisterScrollPane, BorderLayout.CENTER);
}
 
开发者ID:polemonium,项目名称:SE2Project,代码行数:34,代码来源:AusleiheMedienauflisterUI.java

示例11: initComponents

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea();

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                File resolvedFile = null;

                try {
                    resolvedFile = new File(url.toURI());
                } catch (URISyntaxException ex) {
                    ex.printStackTrace();
                }

                final File snapshotFile = resolvedFile;

                if ((snapshotFile != null) && snapshotFile.exists()) {
                    String type = TimedTakeSnapshotProfilingPoint.this.getSnapshotType();
                    if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
                        ResultsManager.getDefault().openSnapshot(snapshotFile);
                    }
                } else {
                    ProfilerDialogs.displayWarning(
                            Bundle.TimedTakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
                }
            }
        };

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.TimedTakeSnapshotProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:53,代码来源:TimedTakeSnapshotProfilingPoint.java

示例12: MetalworksInBox

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public MetalworksInBox() {
    super("In Box", true, true, true, true);

    DefaultMutableTreeNode unread;
    DefaultMutableTreeNode personal;
    DefaultMutableTreeNode business;
    DefaultMutableTreeNode spam;

    DefaultMutableTreeNode top = new DefaultMutableTreeNode("Mail Boxes");

    top.add(unread = new DefaultMutableTreeNode("Unread Mail"));
    top.add(personal = new DefaultMutableTreeNode("Personal"));
    top.add(business = new DefaultMutableTreeNode("Business"));
    top.add(spam = new DefaultMutableTreeNode("Spam"));

    unread.add(new DefaultMutableTreeNode("Buy Stuff Now"));
    unread.add(new DefaultMutableTreeNode("Read Me Now"));
    unread.add(new DefaultMutableTreeNode("Hot Offer"));
    unread.add(new DefaultMutableTreeNode("Re: Re: Thank You"));
    unread.add(new DefaultMutableTreeNode("Fwd: Good Joke"));

    personal.add(new DefaultMutableTreeNode("Hi"));
    personal.add(new DefaultMutableTreeNode("Good to hear from you"));
    personal.add(new DefaultMutableTreeNode("Re: Thank You"));

    business.add(new DefaultMutableTreeNode("Thanks for your order"));
    business.add(new DefaultMutableTreeNode("Price Quote"));
    business.add(new DefaultMutableTreeNode("Here is the invoice"));
    business.add(new DefaultMutableTreeNode(
            "Project Metal: delivered on time"));
    business.add(new DefaultMutableTreeNode("Your salary raise approved"));

    spam.add(new DefaultMutableTreeNode("Buy Now"));
    spam.add(new DefaultMutableTreeNode("Make $$$ Now"));
    spam.add(new DefaultMutableTreeNode("HOT HOT HOT"));
    spam.add(new DefaultMutableTreeNode("Buy Now"));
    spam.add(new DefaultMutableTreeNode("Don't Miss This"));
    spam.add(new DefaultMutableTreeNode("Opportunity in Precious Metals"));
    spam.add(new DefaultMutableTreeNode("Buy Now"));
    spam.add(new DefaultMutableTreeNode("Last Chance"));
    spam.add(new DefaultMutableTreeNode("Buy Now"));
    spam.add(new DefaultMutableTreeNode("Make $$$ Now"));
    spam.add(new DefaultMutableTreeNode("To Hot To Handle"));
    spam.add(new DefaultMutableTreeNode("I'm waiting for your call"));

    JTree tree = new JTree(top);
    JScrollPane treeScroller = new JScrollPane(tree);
    treeScroller.setBackground(tree.getBackground());
    setContentPane(treeScroller);
    setSize(325, 200);
    setLocation(75, 75);

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:54,代码来源:MetalworksInBox.java

示例13: DataTableViewer

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public DataTableViewer(DataTable dataTable, LinkedHashMap<String, Class<? extends Plotter>> availablePlotters,
		boolean showPlotter, String tableMode, boolean autoResize) {
	super(new BorderLayout());

	// create empty buttonCard
	ButtonBarCardPanel bCard = new ButtonBarCardPanel();

	// Build table view
	this.dataTableViewerTable = new DataTableViewerTable(autoResize);
	this.tablePanel = new JPanel(new BorderLayout());
	JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
	infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 5));
	infoPanel.add(generalInfo);
	infoPanel.setOpaque(true);
	infoPanel.setBackground(Colors.WHITE);
	tablePanel.add(infoPanel, BorderLayout.NORTH);
	JScrollPane tableScrollPane = new ExtendedJScrollPane(dataTableViewerTable);
	tableScrollPane.setBorder(BorderFactory.createEmptyBorder(1, 10, 10, 5));
	tableScrollPane.setBackground(Colors.WHITE);
	tableScrollPane.getViewport().setBackground(Colors.WHITE);
	tablePanel.add(tableScrollPane, BorderLayout.CENTER);

	// add data table to the result view
	bCard.addCard(new ResourceCard("data_view", "result_view.data_view"), tablePanel);

	// Add plotters if desired
	if (showPlotter) {
		this.plotterSettings = new PlotterConfigurationModel(availablePlotters, dataTable);
		this.plotterPanel = new PlotterPanel(plotterSettings);
		DataTable plotData = plotterSettings.getDataTable();

		// preface to create ChartConfigationPanel:
		ExampleSet exampleSet = DataTableExampleSetAdapter.createExampleSetFromDataTable(plotData);
		Map<DatasetTransformationType, PlotConfiguration> plotConfigurationMap = PlotConfigurationHistory
				.getPlotConfigurationMap(exampleSet, plotData);
		PlotInstance plotInstance = new PlotInstance(plotConfigurationMap.get(DatasetTransformationType.ORIGINAL),
				plotData);
		this.advancedPanel = new ChartConfigurationPanel(true, plotInstance, plotData,
				plotConfigurationMap.get(DatasetTransformationType.DE_PIVOTED));

		// add Plotter to the result view
		bCard.addCard(new ResourceCard("plot_view", "result_view.plot_view"), plotterPanel);

		// add advanced Charts to the result view
		bCard.addCard(new ResourceCard("advanced_charts", "result_view.advanced_charts"), advancedPanel);
	} // end if (showPlotter)

	// check select desired view
	if (PLOT_MODE.equals(tableMode) && showPlotter) {
		bCard.selectCard("plot_view");
	} else if (ADVANCED_MODE.equals(tableMode) && showPlotter) {
		bCard.selectCard("advanced_charts");
	}

	add(bCard, BorderLayout.CENTER);
	setDataTable(dataTable);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:58,代码来源:DataTableViewer.java

示例14: PerformanceVectorViewer

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public PerformanceVectorViewer(final PerformanceVector performanceVector, final IOContainer container) {
	setLayout(new BorderLayout());

	// all criteria
	final CardLayout cardLayout = new CardLayout();
	final JPanel mainPanel = new JPanel(cardLayout);
	add(mainPanel, BorderLayout.CENTER);
	List<String> criteriaNameList = new LinkedList<>();
	for (int i = 0; i < performanceVector.getSize(); i++) {
		PerformanceCriterion criterion = performanceVector.getCriterion(i);
		criteriaNameList.add(criterion.getName());
		JPanel component = ResultDisplayTools.createVisualizationComponent(criterion, container,
				"Performance Criterion", false);
		JScrollPane criterionPane = new ExtendedJScrollPane(component);
		criterionPane.setBorder(null);
		criterionPane.setBackground(Colors.WHITE);
		mainPanel.add(criterionPane, criterion.getName());
	}
	if (criteriaNameList.isEmpty()) {
		remove(mainPanel);
		add(new ResourceLabel("result_view.no_criterions"));
		return;
	}
	String[] criteriaNames = new String[criteriaNameList.size()];
	criteriaNameList.toArray(criteriaNames);

	// selection list
	final JList<String> criteriaList = new JList<String>(criteriaNames) {

		private static final long serialVersionUID = 3031125186920370793L;

		@Override
		public Dimension getPreferredSize() {
			Dimension dim = super.getPreferredSize();
			dim.width = Math.max(150, dim.width);
			return dim;
		}
	};
	criteriaList.setCellRenderer(new CriterionListCellRenderer());
	criteriaList.setOpaque(false);

	criteriaList.setBorder(BorderFactory.createTitledBorder("Criterion"));
	criteriaList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

	criteriaList.addListSelectionListener(new ListSelectionListener() {

		@Override
		public void valueChanged(ListSelectionEvent e) {
			String selected = criteriaList.getSelectedValue();
			cardLayout.show(mainPanel, selected);
		}
	});

	JScrollPane listScrollPane = new ExtendedJScrollPane(criteriaList);
	listScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 2));
	add(listScrollPane, BorderLayout.WEST);

	// select first criterion
	criteriaList.setSelectedIndices(new int[] { 0 });
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:61,代码来源:PerformanceVectorViewer.java

示例15: AnovaCalculatorViewer

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public AnovaCalculatorViewer(String name, double sumSquaresBetween, int degreesOfFreedom1, double meanSquaresBetween,
		double fValue, double prob, double sumSquaresResiduals, int degreesOfFreedom2, double meanSquaresResiduals,
		double alpha) {

	this.setLayout(new BorderLayout());

	String[] row1 = new String[] { "Between", Tools.formatNumber(sumSquaresBetween), String.valueOf(degreesOfFreedom1),
			Tools.formatNumber(meanSquaresBetween), Tools.formatNumber(fValue), Tools.formatNumber(prob) };
	String[] row2 = new String[] { "Residuals", Tools.formatNumber(sumSquaresResiduals),
			String.valueOf(degreesOfFreedom2), Tools.formatNumber(meanSquaresResiduals), "", "" };
	String[] row3 = new String[] { "Total", Tools.formatNumber(sumSquaresBetween + sumSquaresResiduals),
			String.valueOf(degreesOfFreedom1 + degreesOfFreedom2), "", "", "" };
	String[] header = new String[] { "Source", "Square Sums", "DF", "Mean Squares", "F", "Prob" };
	TableModel model = new DefaultTableModel(new String[][] { row1, row2, row3 }, header);

	ExtendedJTable table = new ExtendedJTable(model, true);
	table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
	table.setRowHighlighting(true);

	String label2Text = null;
	if (prob < alpha) {
		label2Text = "Difference between actual mean values is probably significant, since " + Tools.formatNumber(prob)
				+ " < alpha = " + Tools.formatNumber(alpha);
	} else {
		label2Text = "Difference between actual mean values is probably not significant, since "
				+ Tools.formatNumber(prob) + " > alpha = " + Tools.formatNumber(alpha);
	}
	JLabel label1 = new JLabel("Probability for random values with the same result: " + Tools.formatNumber(prob));
	JLabel label2 = new JLabel(label2Text);

	JPanel panel = new JPanel(new GridBagLayout());
	panel.setOpaque(true);
	panel.setBackground(Colors.WHITE);

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 1.0;
	gbc.weighty = 1.0;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(42, 10, 20, 10);

	JScrollPane scrollPane = new ExtendedJScrollPane(table);
	scrollPane.setBorder(null);
	scrollPane.setBackground(Colors.WHITE);
	scrollPane.getViewport().setBackground(Colors.WHITE);
	panel.add(scrollPane, gbc);

	gbc.gridy += 1;
	gbc.weighty = 0.0;
	gbc.fill = GridBagConstraints.HORIZONTAL;
	gbc.insets = new Insets(5, 10, 5, 10);
	panel.add(label1, gbc);

	gbc.gridy += 1;
	panel.add(label2, gbc);

	this.add(panel, BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:60,代码来源:AnovaCalculatorViewer.java


注:本文中的javax.swing.JScrollPane.setBackground方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。