titleBorder.setTitlePosition(TitledBorder.LEFT); titleBorder.setTitlePosition(TitledBorder.TOP); algorithmSelectorPanel.setBorder(titleBorder); mainPanel.add(algorithmSelectorPanel);
titleBorder.setTitlePosition(TitledBorder.LEFT); titleBorder.setTitlePosition(TitledBorder.TOP); algorithmSelectorPanel.setBorder(titleBorder); mainPanel.add(algorithmSelectorPanel);
public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { algorithmPanel.removeAll(); if (e.getItem().getClass() == String.class) { currentLayout = null; LayoutSettingsDialog.defaultLayout = null; algorithmPanel.setBorder(null); } else { CyLayoutAlgorithm newLayout = (CyLayoutAlgorithm) e.getItem(); LayoutSettingsDialog.defaultLayout = newLayout; // Replace the previous settings panel with a new one JPanel panel = newLayout.getSettingsPanel(); algorithmPanel.removeAll(); algorithmPanel.add(panel); // Add a component listener to the panel in case it gets dynamically updated panel.addComponentListener(this); Border selBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); TitledBorder titleBorder = BorderFactory.createTitledBorder(selBorder, newLayout.toString() + " Settings"); titleBorder.setTitlePosition(TitledBorder.LEFT); titleBorder.setTitlePosition(TitledBorder.TOP); algorithmPanel.setBorder(titleBorder); currentLayout = newLayout; // Remember which one is set } validate(); pack(); } }
/** * Creates the titled border. * * @param title * the title * @return the border */ public static Border createTitledBorder(final String title) { final TitledBorder b = BorderFactory.createTitledBorder(""); b.setTitle(JKMessage.get(title, true)); b.setTitleJustification(TitledBorder.DEFAULT_JUSTIFICATION); b.setTitlePosition(TitledBorder.CENTER); b.setTitleColor(JKColors.TITLE_BORDER_BG); return b; }
border1.setTitlePosition(TitledBorder.ABOVE_TOP); box1.setBorder(BorderFactory.createCompoundBorder(border1, innerBorder)); box1.add(makeLabeledBox(fileNameLabel, new JTextField())); border2.setTitlePosition(TitledBorder.ABOVE_TOP); box2.setBorder(BorderFactory.createCompoundBorder(border2, innerBorder)); box2.add(makeLabeledBox(hostLabel, new JTextField()));
/** * Creates a titled border instance that can be applied to any Swing * component. */ public Border createBorder(Component comp) { TitledBorder b = new TitledBorder(getTitle()); b.setTitlePosition(getPosition()); b.setTitleJustification(getJustification()); b.setTitleColor(new ColorProxy(getTextColorProperty())); return b; }
titleBorder.setTitlePosition(TitledBorder.LEFT); titleBorder.setTitlePosition(TitledBorder.TOP); tunablesPanel.setBorder(titleBorder); if (checkFlag(COLLAPSABLE)) {
border.setTitlePosition(TitledBorder.TOP); border.setTitleJustification(TitledBorder.LEFT); bpanel.setBorder(border);