javax.swing.JScrollPane.setBounds()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(447)

本文整理了Java中javax.swing.JScrollPane.setBounds()方法的一些代码示例,展示了JScrollPane.setBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.setBounds()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:setBounds

JScrollPane.setBounds介绍

暂无

代码示例

代码示例来源:origin: alibaba/druid

@Override
public void componentResized(ComponentEvent arg0) {
  scrollPane.setBounds(10, 10, getWidth() - 20, getHeight() - 80);
  copyrightPanel.setBounds(10, getHeight() - 60, getWidth() - 20, 60);
}

代码示例来源:origin: FudanNLP/fnlp

int width=getWidth()-15;
int height=getHeight()-50;
jspOut.setBounds(sp, sp, width-sp*2, height*5/6);
jspIn.setBounds(sp, height*5/6+sp*2, width*4/5-sp*2, height*1/6);
panel.add(jspIn);
panel.add(jspOut);

代码示例来源:origin: alibaba/druid

scrollPane.setBounds(10, 10, getWidth() - 20, getHeight() - 80);

代码示例来源:origin: stackoverflow.com

JScrollPane scrollPane = new JScrollPane(mainConsole);
scrollPane.setBounds(10,60,780,500);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

代码示例来源:origin: magefree/mage

private void initBounds(boolean rotated) {
  oldWidth = this.getWidth();
  if (rotated) {
    scrollPane.setBounds(50, 50, 100, 100);
  } else {
    scrollPane.setBounds(this.getWidth()*1000/17777,this.getWidth()*1000/1100,
               this.getWidth()*1000/1142,this.getWidth()*1000/2539);
  }
}

代码示例来源: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: 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: stackoverflow.com

scroll.setBounds(0, 200, 900, 150);

代码示例来源:origin: com.alibaba/druid

@Override
public void componentResized(ComponentEvent arg0) {
  scrollPane.setBounds(10, 10, getWidth() - 20, getHeight() - 80);
  copyrightPanel.setBounds(10, getHeight() - 60, getWidth() - 20, 60);
}

代码示例来源:origin: com.alibaba/druid

scrollPane.setBounds(10, 10, getWidth() - 20, getHeight() - 80);

代码示例来源:origin: stackoverflow.com

JScrollPane jScrollPane1= new JScrollPane()
jScrollPane1.setViewportView(jList1);
getContentPane().setLayout(null);// here u specify layout put the layout what u want
getContentPane().add(jScrollPane1);// add to the contentPane
jScrollPane1.setBounds(126, 63, 100, 100);// here we set coordinates x, y width height cause we have null layout
pack();// Size the frame.

代码示例来源:origin: ron190/jsql-injection

@Override
  public void layoutContainer(Container target) {
    super.layoutContainer(target);
    int width = LightScrollPane.this.getWidth();
    int height = LightScrollPane.this.getHeight();
    LightScrollPane.this.scrollPane.setBounds(0, 0, width, height);
    int scrollBarSize = THUMB_SIZE;
    int cornerOffset = LightScrollPane.this.verticalScrollBar.isVisible() && LightScrollPane.this.horizontalScrollBar.isVisible() ? scrollBarSize : 0;
    if (LightScrollPane.this.verticalScrollBar.isVisible()) {
      LightScrollPane.this.verticalScrollBar.setBounds(
        LightScrollPane.this.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT
        ? 0
        : width - scrollBarSize,
        0,
        scrollBarSize,
        height - cornerOffset
      );
    }
    if (LightScrollPane.this.horizontalScrollBar.isVisible()) {
      LightScrollPane.this.horizontalScrollBar.setBounds(
        0,
        height - scrollBarSize,
        width - cornerOffset,
        scrollBarSize
      );
    }
  }
});

代码示例来源:origin: stackoverflow.com

JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(23, 40, 394, 191);
frame.getContentPane().add(scrollPane);

JTextArea textArea_1 = new JTextArea();
scrollPane.setViewportView(textArea_1);`

代码示例来源:origin: com.github.insubstantial/flamingo

@Override
public void layoutContainer(Container parent) {
  Insets insets = parent.getInsets();
  int left = insets.left;
  int right = insets.right;
  int top = insets.top;
  int bottom = insets.bottom;
  scroll.setBounds(left, top, parent.getWidth() - left - right,
      parent.getHeight() - top - bottom);
}

代码示例来源:origin: stackoverflow.com

ImageIcon imageIcon = new ImageIcon("src\\SwingExp\\img\\map.gif");
JLabel map = new JLabel( imageIcon );
JScrollPane scrollPane = new JScrollPane( map );
//JScrollPane scrollPane = new JScrollPane(new JLabel(imageIcon));
scrollPane.setBounds(5,5,600,400);
JLabel usaLabel = new JLabel("U.S.A.");
usaLabel.setBounds(210,200,50,25);
map.add( usaLabel );
//mapPanel.add(usaLabel);

代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine

/**
 * Creates the JTable for displaying the input archives.
 */
private void createItemTable()
{
  itemTable = new JTable(controller.getConfigErrors());
  itemTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  itemScrollPane = new JScrollPane(itemTable);
  itemScrollPane.setBounds(10, 10, 470, 180);
  this.add(itemScrollPane);
}

代码示例来源:origin: stackoverflow.com

DefaultTableModel modelo = new DefaultTableModel();
 modelo.setColumnCount(1);
 modelo.addColumn("Prueba");
 tblTrans = new JTable(modelo);
 JScrollPane sPane = new JScrollPane(tblTrans);
 sPane.setBounds(316, 47, 248, 243);
 contentPane.add(sPane);

代码示例来源:origin: info.aduna.clustermap/aduna-clustermap-core

public void layoutContainer(Container parent) {
  Rectangle b = parent.getBounds();
  b.x = 0;
  b.y = 0;
  scrollPane.setBounds(b);
  toolTipPanel.setBounds(b);
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

public void setBounds(int x, int y, int w, int h) {
  super.setBounds(x, y, w, h);
  sp.setBounds(0, y + 12, w, h - 23);
  sp.revalidate();
  jt.setBounds(0, 0, w, 20);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public void doLayout() {
  Insets ins = getInsets();
  Dimension bttn = btn.getMinimumSize();
  Dimension lbll = lbl.getPreferredSize();
  
  int height = Math.max (bttn.height, lbll.height);
  int right = getWidth() - (ins.right + bttn.width);
  
  
  btn.setBounds (right, ins.top, 
    bttn.width, height);
  
  lbl.setBounds (ins.left, ins.top, right, height);
  
  jsc.setBounds (ins.left, height, getWidth() - (ins.left + ins.right), 
    getHeight() - height);
}

相关文章

JScrollPane类方法