aboutScroll.setVerticalScrollBarPolicy(20); aboutScroll.setHorizontalScrollBarPolicy(30); aboutScroll.setLocation(140, 5); aboutScroll.setSize(290, 185);
private JComponent createCode() { final JLabel codeLabel = new JLabel(ImageCreator.IMG_OWASP); codeLabel.setLocation(20, 45); codeLabel.setSize(100, 100); final URL codeURL = ClassLoader.getSystemClassLoader() .getResource("LICENSE/CODE.txt"); JEditorPane code; try { code = new JEditorPane(codeURL); } catch (final IOException eAbout) { code = new JEditorPane(); code.setText("Code information cannot be found!"); } code.setEditable(false); code.addKeyListener(this); final JScrollPane codeScroll = new JScrollPane(code); codeScroll.setVerticalScrollBarPolicy(20); codeScroll.setHorizontalScrollBarPolicy(30); codeScroll.setLocation(140, 5); codeScroll.setSize(290, 185); final JPanel codePanel = new JPanel(); codePanel.setLayout(null); codePanel.add(codeLabel); codePanel.add(codeScroll); return codePanel; }
disclaimerScroll.setVerticalScrollBarPolicy(20); disclaimerScroll.setHorizontalScrollBarPolicy(30); disclaimerScroll.setLocation(140, 5); disclaimerScroll.setSize(290, 185);
public void display_esa(List<ConceptData> cDoc){ panel1 = new JPanel(); final JTextArea textArea = new JTextArea(5, 30); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setPreferredSize(new Dimension(500, 400)); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); textArea.setEditable(false); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); for (ConceptData key : cDoc) { textArea.append(key.concept + ", \t" + String.format("%.4f", key.score)+"\n"); } textArea.setCaretPosition(textArea.getDocument().getLength()); //window.setLayout(new FlowLayout()); JButton back=new JButton("Go Back"); back.setBounds(30,50,550,430); back.addActionListener(back()); panel1.add(back); scrollPane.setLocation(30, 150); panel1.add(scrollPane); window.remove(myPanel); window.setContentPane(panel1); window.validate(); window.repaint(); }
/** @param parent */ public void layoutContainer(Container parent) { Dimension margin_sz = m_colmargin.getPreferredSize(); Insets insets = parent.getInsets(); int colm_x = insets.left + margin_sz.width; int colm_y = insets.top; int colm_width = parent.getWidth() - insets.right - colm_x; int colm_height = margin_sz.height; int rowm_x = insets.left; int rowm_y = insets.top + margin_sz.height; int rowm_width = margin_sz.width; int rowm_height = parent.getHeight() - insets.bottom - rowm_y; m_scroll.setLocation(colm_x, rowm_y); m_scroll.setSize(colm_width, rowm_height); m_colmargin.setLocation(colm_x, colm_y); m_colmargin.setSize(colm_width, colm_height); m_rowmargin.setLocation(rowm_x, rowm_y); m_rowmargin.setSize(rowm_width, rowm_height); }
@ScriptFunction @Override public void setLeft(int aValue) { if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) { MarginLayout.ajustLeft(this, aValue); } super.setLocation(aValue, getTop()); }
@ScriptFunction @Override public void setTop(int aValue) { if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) { MarginLayout.ajustTop(this, aValue); } super.setLocation(getLeft(), aValue); }
sp.setLocation(290, 20); sp.setSize(250, 350); sp1.setLocation(290, 390); sp1.setSize(250, 150);
/** * A call of this method should validate the positions of the panels * components. */ @Override public void relocate() { int w = 555, h = 235; int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2; archiveScrollPane.setLocation(x, y); addArchiveButton.setLocation(x + 435, y + 10); removeArchiveButton.setLocation(x + 435, y + 40); encodingLabel.setLocation(x, y + 220); encodingField.setLocation(x + 210, y + 220); surrogatePanel.setLocation(x + 415, y + 85); }
/** * A call of this method should validate the positions of the panels * components. */ @Override public void relocate() { int w = 555, h = 235; int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2; archiveScrollPane.setLocation(x, y); addArchiveButton.setLocation(x + 435, y + 10); removeArchiveButton.setLocation(x + 435, y + 40); encodingLabel.setLocation(x, y + 220); encodingField.setLocation(x + 210, y + 220); surrogatePanel.setLocation(x + 415, y + 85); }