@Test public void testInstall() { System.out.println("install"); JComponent parent = new JTextField(); ComponentBorder instance = new ComponentBorder(new JButton("test")); instance.install(parent); }
public void install(JComponent parent) { this.parent = parent; determineInsetsAndAlignment(); Border current = parent.getBorder(); if (current == null) { parent.setBorder(this); } else { CompoundBorder compound = new CompoundBorder(current, this); parent.setBorder(compound); } parent.add(component); }
ComponentBorder implements Border { public void install(JComponent parent) { this.parent = parent; determineInsetsAndAlignment(); Border current = parent.getBorder(); if (current == null) { parent.setBorder(this); } else { CompoundBorder compound = new CompoundBorder(current, this); parent.setBorder(compound); } parent.add(component); } }
ComponentBorder implements Border { public void install(JComponent parent) { this.parent = parent; determineInsetsAndAlignment(); Border current = parent.getBorder(); if (current == null) { parent.setBorder(this); } else { CompoundBorder compound = new CompoundBorder(current, this); parent.setBorder(compound); } parent.add(component); } ComponentBorder(JComponent component);  ComponentBorder(JComponent component, Edge edge);  ComponentBorder(JComponent component, Edge edge, float alignment); }
ComponentBorder implements Border { public void install(JComponent parent) { this.parent = parent; determineInsetsAndAlignment(); Border current = parent.getBorder(); if (current == null) { parent.setBorder(this); } else { CompoundBorder compound = new CompoundBorder(current, this); parent.setBorder(compound); } parent.add(component); } ComponentBorder(JComponent component);  ComponentBorder(JComponent component, Edge edge);  ComponentBorder(JComponent component, Edge edge, float alignment); boolean isAdjustInsets(); void setAdjustInsets(boolean adjustInsets); float getAlignment(); final void setAlignment(float alignment); Edge getEdge(); final void setEdge(Edge edge); int getGap(); void setGap(int gap); @Override Insets getBorderInsets(Component c); @Override boolean isBorderOpaque(); @Override void paintBorder(Component c, Graphics g, int x, int y, int width, int height); void install(JComponent parent); }
ComponentBorder implements Border { public void install(JComponent parent) { this.parent = parent; determineInsetsAndAlignment(); Border current = parent.getBorder(); if (current == null) { parent.setBorder(this); } else { CompoundBorder compound = new CompoundBorder(current, this); parent.setBorder(compound); } parent.add(component); } ComponentBorder(JComponent component);  ComponentBorder(JComponent component, Edge edge);  ComponentBorder(JComponent component, Edge edge, float alignment); boolean isAdjustInsets(); void setAdjustInsets(boolean adjustInsets); float getAlignment(); final void setAlignment(float alignment); Edge getEdge(); final void setEdge(Edge edge); int getGap(); void setGap(int gap); @Override Insets getBorderInsets(Component c); @Override boolean isBorderOpaque(); @Override void paintBorder(Component c, Graphics g, int x, int y, int width, int height); void install(JComponent parent); static final float LEADING; static final float CENTER; static final float TRAILING; }