本文整理了Java中javax.swing.JScrollPane.setBorder()
方法的一些代码示例,展示了JScrollPane.setBorder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.setBorder()
方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:setBorder
暂无
代码示例来源:origin: alibaba/druid
/**
* 将各个界面添加到JFrame中
*
* @param pane JFrame内部的Container对象
*/
private void addComponentsToPane(Container pane) {
JScrollPane scrollPane = new JScrollPane();
JPanel contentPanel = new JPanel();
contentPanel.setLayout(new GridLayout(0, 1));
final JTextArea sqlField = new JTextArea(formatSql, 8, 20);
final JScrollPane content1 = new JScrollPane(sqlField);
content1.setBorder((TitledBorder) BorderFactory.createTitledBorder("SQL语句"));
contentPanel.add(content1);
addTable(contentPanel, "解析信息", parseData);
addTable(contentPanel, "上次慢查询信息", lastSlowData);
addTable(contentPanel, "上次错误查询信息", lastErrorData);
addTable(contentPanel, "其他信息", otherData);
scrollPane.setViewportView(contentPanel);
pane.add(scrollPane, BorderLayout.CENTER);
}
代码示例来源:origin: stanfordnlp/CoreNLP
private Box makeTSurgeonScriptArea() {
Box tsurgeonBox = Box.createHorizontalBox();
scriptLabel = new JLabel("Tsurgeon script: ");
tsurgeonScript = new JTextArea();
tsurgeonScript.setBorder(BorderFactory.createEmptyBorder());
tsurgeonScript.setFocusTraversalKeysEnabled(true);
JScrollPane scriptScroller = new JScrollPane(tsurgeonScript);
scriptScroller.setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
//scriptScroller.setEnabled(tsurgeonEnabled);
tsurgeonBox.add(scriptLabel);
tsurgeonBox.add(scriptScroller);
//tsurgeonBox.setBorder(BorderFactory.createEtchedBorder());
return tsurgeonBox;
}
代码示例来源:origin: log4j/log4j
final JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setBorder(BorderFactory.createTitledBorder("Events: "));
scrollPane.setPreferredSize(new Dimension(900, 300));
details.setPreferredSize(new Dimension(900, 300));
代码示例来源:origin: bobbylight/RSyntaxTextArea
private void setBottomPanel() {
final JPanel panel = new JPanel(new BorderLayout());
panel.add(new JSeparator(), BorderLayout.NORTH);
SizeGrip sg = new SizeGrip();
panel.add(sg, BorderLayout.LINE_END);
MouseInputAdapter adapter = new MouseInputAdapter() {
private Point lastPoint;
label.setHorizontalAlignment(SwingConstants.TRAILING);
label.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
panel.add(label);
panel.addMouseListener(tipListener);
Component comp = cp.getComponent(0);
cp.remove(0);
JScrollPane sp = new JScrollPane(comp);
Border emptyBorder = BorderFactory.createEmptyBorder();
sp.setBorder(emptyBorder);
sp.setViewportBorder(emptyBorder);
sp.setBackground(textArea.getBackground());
代码示例来源:origin: nodebox/nodebox
public PortView(PortPane pane, NodeBoxDocument document) {
this.pane = pane;
this.document = document;
setLayout(new BorderLayout());
controlPanel = new ControlPanel(new GridBagLayout());
// controlPanel = new JPanel(new GridBagLayout());
//controlPanel.setOpaque(false);
//controlPanel.setBackground(Theme.getInstance().getParameterViewBackgroundColor());
JScrollPane scrollPane = new JScrollPane(controlPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
add(scrollPane, BorderLayout.CENTER);
}
代码示例来源:origin: org.codehaus.groovy/groovy
private void jbInit(Reader reader) throws Exception {
final Border border = BorderFactory.createEmptyBorder();
jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
tokenPane.setEditable(false);
tokenPane.setText("");
scriptPane.setFont(new java.awt.Font("DialogInput", 0, 12));
scriptPane.setEditable(false);
scriptPane.setMargin(new Insets(5, 5, 5, 5));
scriptPane.setText("");
jScrollPane1.setBorder(border);
jScrollPane2.setBorder(border);
jSplitPane1.setMinimumSize(new Dimension(800, 600));
mainPanel.add(jSplitPane1, BorderLayout.CENTER);
if (reader == null) {
mainPanel.add(jbutton, BorderLayout.NORTH);
}
this.getContentPane().add(mainPanel);
jSplitPane1.add(jScrollPane1, JSplitPane.LEFT);
jScrollPane1.getViewport().add(tokenPane, null);
jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT);
jScrollPane2.getViewport().add(scriptPane, null);
jScrollPane1.setColumnHeaderView(new JLabel(" Token Stream:"));
jScrollPane2.setColumnHeaderView(new JLabel(" Input Script:"));
jSplitPane1.setResizeWeight(0.5);
}
代码示例来源:origin: omegat-org/omegat
public PerFileMatchStatisticsPanel(StatisticsWindow window) {
super(window);
setLayout(new BorderLayout());
tablesPanel = new ReasonablySizedPanel();
tablesPanel.setLayout(new BoxLayout(tablesPanel, BoxLayout.Y_AXIS));
scrollPane = new JScrollPane(tablesPanel);
scrollPane.setBorder(new EmptyBorder(0, 0, 0, 0));
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
add(scrollPane);
}
代码示例来源:origin: locationtech/jts
void jbInit() throws Exception {
this.setLayout(tabPanelLayout);
txtResult.setWrapStyleWord(true);
txtResult.setLineWrap(true);
txtResult.setBackground(SystemColor.control);
labelPanel.setLayout(labelPanelLayout);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,4,2,2));
labelPanel.add(resultLabel);
resultLabel.setText("Value");
this.add(jScrollPane1, BorderLayout.CENTER);
this.add(labelPanel, BorderLayout.NORTH);
jScrollPane1.setBorder(BorderFactory.createLoweredBevelBorder());
jScrollPane1.getViewport().add(txtResult, null);
}
代码示例来源:origin: magefree/mage
public Cards(boolean skipAddingScrollPane) {
initComponents(skipAddingScrollPane);
setOpaque(false);
//cardArea.setOpaque(false);
setBackgroundColor(new Color(0, 0, 0, 100));
if (!skipAddingScrollPane) {
jScrollPane1.setOpaque(false);
jScrollPane1.getViewport().setOpaque(false);
jScrollPane1.setBorder(EMPTY_BORDER);
}
if (Plugins.instance.isCardPluginLoaded()) {
cardArea.setLayout(null);
}
cardArea.setBorder(EMPTY_BORDER);
setGUISize();
}
代码示例来源:origin: stackoverflow.com
public static void main(String[] args) {
JFrame frame = new TestScrollPane();
JPanel panel = new JPanel();
JTable table = new JTable();
panel.setLayout(new BorderLayout());
panel.add(new JLabel("NORTH"), BorderLayout.NORTH);
panel.add(new JLabel("SOUTH"), BorderLayout.SOUTH);
JScrollPane sp = new JScrollPane(table);
sp.setBorder(BorderFactory.createEmptyBorder());
panel.add(sp, BorderLayout.CENTER);
frame.add(panel);
frame.setVisible(true);
}
代码示例来源:origin: magefree/mage
jScrollPaneTxt = new javax.swing.JScrollPane();
txtConversation = new mage.client.components.ColorPane();
txtMessage = new javax.swing.JTextField();
jScrollPaneTxt.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jScrollPaneTxt.setPreferredSize(new java.awt.Dimension(32767, 32767));
jScrollPaneTxt.setViewportView(txtConversation);
txtMessage.setMaximumSize(new java.awt.Dimension(5000, 70));
txtMessage.setMinimumSize(new java.awt.Dimension(6, 70));
txtMessage.setName(""); // NOI18N
txtMessage.setPreferredSize(new java.awt.Dimension(6, 70));
代码示例来源:origin: nodebox/nodebox
public DataSheet() {
super(new BorderLayout());
table = new DataTable();
table.setAutoCreateRowSorter(true);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.addColumn(new TableColumn(0));
tableModel = new DataTableModel();
table.setModel(tableModel);
JScrollPane tableScroll = new JScrollPane(table);
tableScroll.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
add(tableScroll, BorderLayout.CENTER);
}
代码示例来源:origin: magefree/mage
@SuppressWarnings("unchecked")
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jScrollPane1.setBorder(BorderFactory.createEmptyBorder());
gamePanel = new mage.client.game.GamePanel();
jScrollPane1.setViewportView(gamePanel);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE)
.addGap(0, 600, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.addGap(0, 400, Short.MAX_VALUE)
);
}
代码示例来源:origin: stanfordnlp/CoreNLP
recentTregexPatterns.setMinimumSize(new Dimension(120, 24));
recentTregexPatterns.addActionListener(this);
tregexPattern.setLineWrap(true);
JScrollPane patternScroller = new JScrollPane(tregexPattern);
patternScroller.setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
JPanel tregexInput = new JPanel();
tregexInput.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.gridx = 0;
c.gridy = 0;
tregexInput.add(recentLabel, c);
c.weightx = 12.0;
c.gridwidth = GridBagConstraints.REMAINDER;
c.gridx = 1;
tregexInput.add(recentTregexPatterns, c);
c.weightx = 1.0;
c.gridwidth = 1; //reset to default
c.gridx = 0;
c.gridy = 1;
tregexInput.add(patternLabel,c);
c.gridx = 1;
c.weightx = 12.0;
代码示例来源:origin: magefree/mage
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
text = new javax.swing.JTextPane();
setMinimumSize(getPreferredSize());
setOpaque(false);
setPreferredSize(new Dimension(dimension.frameWidth, dimension.frameHeight));
setLayout(null);
jScrollPane1.setBorder(null);
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane1.setFocusable(false);
jScrollPane1.setOpaque(false);
text.setBorder(null);
text.setEditable(false);
text.setFont(new java.awt.Font("Arial", 0, 9));
text.setFocusable(false);
text.setOpaque(false);
jScrollPane1.setViewportView(text);
add(jScrollPane1);
jScrollPane1.setBounds(20, 110, 130, 100);
jScrollPane1.setBounds(new Rectangle(dimension.contentXOffset, dimension.textYOffset, dimension.textWidth, dimension.textHeight));
}// </editor-fold>//GEN-END:initComponents
代码示例来源:origin: nodebox/nodebox
JScrollPane messagesScroll = new JScrollPane(consoleMessages, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
messagesScroll.setBorder(BorderFactory.createEmptyBorder());
consolePrompt.setBorder(new PromptBorder());
setLayout(new BorderLayout());
add(messagesScroll, BorderLayout.CENTER);
add(consolePrompt, BorderLayout.SOUTH);
代码示例来源:origin: magefree/mage
private void initComponents() {
setOpaque(false);
jPanel = new JLayeredPane();
jPanel.setLayout(null);
jPanel.setOpaque(false);
jScrollPane = new JScrollPane(jPanel);
Border empty = new EmptyBorder(0, 0, 0, 0);
jScrollPane.setBorder(empty);
jScrollPane.setViewportBorder(empty);
jScrollPane.setOpaque(false);
jScrollPane.getViewport().setOpaque(false);
this.add(jScrollPane);
}
代码示例来源:origin: kiegroup/optaplanner
private Container createContentPane() {
JPanel contentPane = new JPanel(new BorderLayout(5, 5));
contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JLabel titleLabel = new JLabel("Which example do you want to see?", JLabel.CENTER);
titleLabel.setFont(titleLabel.getFont().deriveFont(20.0f));
contentPane.add(titleLabel, BorderLayout.NORTH);
JScrollPane examplesScrollPane = new JScrollPane(createExamplesPanel());
examplesScrollPane.getHorizontalScrollBar().setUnitIncrement(20);
examplesScrollPane.getVerticalScrollBar().setUnitIncrement(20);
examplesScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
contentPane.add(examplesScrollPane, BorderLayout.CENTER);
JPanel bottomPanel = new JPanel(new BorderLayout(5, 5));
bottomPanel.add(createDescriptionPanel(), BorderLayout.CENTER);
bottomPanel.add(createExtraPanel(), BorderLayout.EAST);
contentPane.add(bottomPanel, BorderLayout.SOUTH);
return contentPane;
}
代码示例来源:origin: magefree/mage
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
scrollPane = new javax.swing.JScrollPane();
text = new javax.swing.JTextPane();
setFocusable(false);
setMinimumSize(new Dimension(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT));
setName("bigCardPanel"); // NOI18N
setOpaque(false);
setPreferredSize(getMinimumSize());
setLayout(null);
scrollPane.setBorder(null);
scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setOpaque(false);
text.setEditable(false);
text.setFocusable(false);
text.setOpaque(false);
scrollPane.setViewportView(text);
add(scrollPane);
scrollPane.setBounds(20, 230, 210, 120);
scrollPane.setBounds(new Rectangle(CONTENT_MAX_XOFFSET, TEXT_MAX_YOFFSET, TEXT_MAX_WIDTH, TEXT_MAX_HEIGHT));
}// </editor-fold>//GEN-END:initComponents
代码示例来源:origin: kaikramer/keystore-explorer
private void init() {
listPanel = new RdnPanelList(currentName, editable);
JScrollPane jScrollPane = new JScrollPane(listPanel);
jScrollPane.setViewportBorder(null);
jScrollPane.setBorder(BorderFactory.createEmptyBorder());
jScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
jScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
setLayout(new BorderLayout());
add(jScrollPane, BorderLayout.CENTER);
}
内容来源于网络,如有侵权,请联系作者删除!