本文整理汇总了Java中javax.swing.JScrollPane.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setBorder方法的具体用法?Java JScrollPane.setBorder怎么用?Java JScrollPane.setBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setBorder方法的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);
}
示例2: 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);
_medienTableModel = new VormerkMedienTableModel();
_medienTable = new JTable();
medienAuflisterScrollPane.setViewportView(_medienTable);
_medienTable.setModel(_medienTableModel);
JTableHeader tableHeader = _medienTable.getTableHeader();
tableHeader.setFont(UIConstants.HEADER_FONT);
tableHeader.setReorderingAllowed(false);
tableHeader.setResizingAllowed(false);
_medienTable.setFont(UIConstants.TEXT_FONT);
_hauptPanel.add(medienAuflisterScrollPane, BorderLayout.CENTER);
}
示例3: 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);
}
示例4: erzeugeKundenAnzeiger
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Erzeugt das Panel in dem die Kundendetails angezeigt werden.
*/
private void erzeugeKundenAnzeiger()
{
JScrollPane medienAnzeigerScrollPane = new JScrollPane();
medienAnzeigerScrollPane.setPreferredSize(new Dimension(-1, 160));
medienAnzeigerScrollPane.setSize(-1, -1);
medienAnzeigerScrollPane.setBorder(BorderFactory.createTitledBorder(
null, "Ausgewählter Kunde", TitledBorder.LEADING,
TitledBorder.DEFAULT_POSITION, UIConstants.HEADER_FONT));
medienAnzeigerScrollPane.setBackground(UIConstants.BACKGROUND_COLOR);
medienAnzeigerScrollPane.getVerticalScrollBar()
.setBackground(UIConstants.BACKGROUND_COLOR);
medienAnzeigerScrollPane.getHorizontalScrollBar()
.setBackground(UIConstants.BACKGROUND_COLOR);
_kundenAnzeigerTextArea = new JTextArea();
_kundenAnzeigerTextArea.setBackground(UIConstants.BACKGROUND_COLOR);
medienAnzeigerScrollPane.setViewportView(_kundenAnzeigerTextArea);
_kundenAnzeigerTextArea.setEditable(false);
_kundenAnzeigerTextArea.setFont(UIConstants.TEXT_FONT);
_hauptPanel.add(medienAnzeigerScrollPane, BorderLayout.CENTER);
}
示例5: mxCellEditor
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
*
*/
public mxCellEditor(mxGraphComponent graphComponent) {
this.graphComponent = graphComponent;
// Creates the plain text editor
textArea = new JTextArea();
textArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
textArea.setOpaque(false);
// Creates the HTML editor
editorPane = new JEditorPane();
editorPane.setOpaque(false);
editorPane.setBackground(new Color(0, 0, 0, 0));
editorPane.setContentType("text/html");
// Workaround for inserted linefeeds in HTML markup with
// lines that are longar than 80 chars
editorPane.setEditorKit(new NoLinefeedHtmlEditorKit());
// Creates the scollpane that contains the editor
// FIXME: Cursor not visible when scrolling
scrollPane = new JScrollPane();
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.getViewport().setOpaque(false);
scrollPane.setVisible(false);
scrollPane.setOpaque(false);
// Installs custom actions
editorPane.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
textArea.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
editorPane.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
textArea.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
// Remembers the action map key for the enter keystroke
editorEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
textEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
}
示例6: PackPanel
import javax.swing.JScrollPane; //导入方法依赖的package包/类
public PackPanel()
{
super(new BorderLayout());
add(new JLabel("Game Packer."), BorderLayout.NORTH);
JScrollPane editorScrollPane = new JScrollPane(buildEditor());
editorScrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.LIGHT_GRAY));
add(editorScrollPane, BorderLayout.CENTER);
packBtn = new JButton("Spiel packen");
packBtn.addActionListener(this);
add(packBtn, BorderLayout.SOUTH);
}
示例7: TablePanel
import javax.swing.JScrollPane; //导入方法依赖的package包/类
public TablePanel() {
table = new PopulationVectorTable();
table.setAutoscrolls(true);
jsp = new JScrollPane(table);
jsp.setBorder(new EmptyBorder(10, 10, 10, 10));
jsp.setPreferredSize(new Dimension(202, 92));
title = new JLabel("<html><b>Population mix</b>");
titlePanel = new JPanel(new FlowLayout());
titlePanel.add(title);
globalPanel = new JPanel(new BorderLayout());
globalPanel.add(titlePanel, BorderLayout.NORTH);
globalPanel.add(jsp, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(globalPanel, BorderLayout.NORTH);
}
示例8: initComponents
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout(3, 3));
setBorder(new EmptyBorder(5, 5, 5, 5));
addModeButton = new JButton("Add Mode");
addModeButton.setMinimumSize(DIM_BUTTON_M);
OptionTable = new TimingOptionTable();
JScrollPane OptionPane = new JScrollPane(OptionTable);
OptionPane.setBorder(new TitledBorder(new EtchedBorder(), "Timing Options"));
add(addModeButton, BorderLayout.NORTH);
add(OptionPane, BorderLayout.CENTER);
}
示例9: createScrollPane
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private JScrollPane createScrollPane(Component inner) {
JScrollPane result = new JScrollPane(inner);
JViewport vp = result.getViewport();
vp.addMouseListener(this);
MarginViewportUI ui = (MarginViewportUI) MarginViewportUI.createUI(vp);
vp.setUI(ui);
ui.setMarginPainted(marginPainted);
ui.setMarginColor(marginColor);
ui.setEmptyString(emptyString);
result.setBorder(BorderFactory.createEmptyBorder());
result.setViewportBorder(result.getBorder());
return result;
}
示例10: LongMessageDialog
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Creates a dialog to display a long message.
*
* @param owner
* the owner window in which the dialog is displayed
* @param i18nKey
* the i18n key
* @param message
* the actual message
* @param i18nArgs
* additional i18n arguments
* @since 6.5.0
*/
public LongMessageDialog(Window owner, String i18nKey, String message, Object... i18nArgs) {
super(owner, i18nKey, ModalityType.APPLICATION_MODAL, i18nArgs);
JEditorPane textComponent = new ExtendedHTMLJEditorPane("text/html", message);
// so it does not steel ENTER from the default button
textComponent.setFocusable(false);
StyleSheet css = ((HTMLEditorKit) textComponent.getEditorKit()).getStyleSheet();
css.addRule("body { margin : 0; font-family : sans-serif; font-size : 9px; font-style : normal; }");
css.addRule(".error { font-weight:bold; color:red; font-style:plain; }");
css.addRule("code { font-weight:bold; color:#000088; }");
textComponent.setEditable(false);
JScrollPane scrollPane = new ExtendedJScrollPane(textComponent);
scrollPane.setBorder(createBorder());
layoutDefault(scrollPane, NORMAL, makeCloseButton());
}
示例11: guiInit
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void guiInit() {
removeAll();
JScrollPane scrollPane = new JScrollPane(formDesigner.getDesignCanvas());
scrollPane.setBorder(null); // disable border, winsys will handle borders itself
scrollPane.setViewportBorder(null); // disable also GTK L&F viewport border
scrollPane.getVerticalScrollBar().setUnitIncrement(5); // Issue 50054
scrollPane.getHorizontalScrollBar().setUnitIncrement(5);
add(scrollPane); // if not yet loaded, the canvas shows "Loading"
setupAssistant(); // if not yet loaded, a blank placeholder panel is used
}
示例12: 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;
}
示例13: createTablePane
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/** Creates the pane for the table model. */
public Container createTablePane() {
JPanel result = new JPanel(new BorderLayout());
JScrollPane scrollPane = new JScrollPane(this.table);
scrollPane.setBorder(new BevelBorder(BevelBorder.LOWERED));
result.add(scrollPane);
result.add(getErrorLabel(), BorderLayout.SOUTH);
return result;
}
示例14: StatisticsPanel
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Creates the statistics panel.
*
* @param freeColClient The {@code FreeColClient} for the game.
* @param serverStatistics A map of key,value pairs of server statistics.
* @param clientStatistics A map of key,value pairs of client statistics.
*/
public StatisticsPanel(FreeColClient freeColClient,
Map<String, String> serverStatistics,
Map<String, String> clientStatistics) {
super(freeColClient, new BorderLayout());
// Title
JPanel header = new JPanel();
this.add(header, BorderLayout.PAGE_START);
header.add(Utility.localizedLabel("statistics"), JPanel.CENTER_ALIGNMENT);
// Actual stats panel
JPanel statsPanel = new JPanel(new GridLayout(1,2));
JScrollPane scrollPane = new JScrollPane(statsPanel,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
// correct way to make scroll pane opaque
scrollPane.getViewport().setOpaque(false);
scrollPane.setBorder(null);
this.add(scrollPane,BorderLayout.CENTER);
statsPanel.add(displayStatsMessage("client", clientStatistics));
statsPanel.add(displayStatsMessage("server", serverStatistics));
add(okButton, BorderLayout.PAGE_END);
setSize(getPreferredSize());
}
示例15: handleTabSwitched
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void handleTabSwitched(String searchText, List<String> matchedKeywords) {
final int selectedIndex = tabbedPanel.getSelectedIndex() >= 0 ? tabbedPanel.getSelectedIndex() : -1;
if (selectedIndex != -1) {
String category = tabbedPanel.getTitleAt(selectedIndex);
if (tabbedPanel.getSelectedComponent() instanceof JLabel) {
JComponent panel = model.getPanel(category);
if( null == panel.getBorder() ) {
panel.setBorder(BorderFactory.createEmptyBorder(11,11,11,11));
}
JScrollPane scroll = new JScrollPane(panel);
scroll.setOpaque(false);
scroll.getViewport().setOpaque(false);
scroll.setBorder(BorderFactory.createEmptyBorder());
scroll.getVerticalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
scroll.getHorizontalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
tabbedPanel.setComponentAt(tabbedPanel.getSelectedIndex(), scroll);
}
model.update(category);
if (searchText != null && matchedKeywords != null) {
OptionsPanelController controller = model.getController(model.getID(category));
if(controller == null) {
LOGGER.log(Level.WARNING, "No controller found for category: {0}", category); //NOI18N
} else {
controller.handleSuccessfulSearch(searchText, matchedKeywords);
}
}
firePropertyChange (OptionsPanelController.PROP_HELP_CTX, null, null);
}
}