类javax.swing.border.EmptyBorder源码实例Demo

下面列出了怎么用javax.swing.border.EmptyBorder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: plugins   文件: XpInfoBox.java
private void setStyle(Style style)
{
	container.removeAll();

	if (style == Style.SIMPLE)
	{
		progressWrapper.setBorder(new EmptyBorder(7, 7, 7, 7));
		container.add(skillWrapper, BorderLayout.WEST);
		container.add(progressWrapper, BorderLayout.CENTER);
	}
	else
	{
		progressWrapper.setBorder(new EmptyBorder(4, 7, 7, 7));
		container.add(skillWrapper, BorderLayout.WEST);
		container.add(statsPanel, BorderLayout.CENTER);
		container.add(progressWrapper, BorderLayout.SOUTH);
	}

	panel.revalidate();
	this.style = style;
}
 
源代码2 项目: plugins   文件: WorldTableRow.java
/**
 * Builds the world list field (containing the country's flag and the world index).
 */
private JPanel buildWorldField()
{
	JPanel column = new JPanel(new BorderLayout(7, 0));
	column.setBorder(new EmptyBorder(0, 5, 0, 5));

	worldField = new JLabel(world.getId() + "");

	ImageIcon flagIcon = getFlag(world.getRegion());
	if (flagIcon != null)
	{
		JLabel flag = new JLabel(flagIcon);
		column.add(flag, BorderLayout.WEST);
	}
	column.add(worldField, BorderLayout.CENTER);

	return column;
}
 
源代码3 项目: ghidra   文件: RenameDataFieldDialog.java
private JPanel create() {
recentChoices = new GhidraComboBox<>();
      recentChoices.setEditable(true);

JPanel mainPanel = new JPanel(new BorderLayout());
JPanel topPanel = new JPanel(new BorderLayout());

Border border = BorderFactory.createTitledBorder("Data Field Name");
topPanel.setBorder(border);
	
mainPanel.add(topPanel, BorderLayout.NORTH);

topPanel.add(recentChoices, BorderLayout.NORTH);

      choiceTextField = (JTextField)recentChoices.getEditor().getEditorComponent();
      setFocusComponent(choiceTextField);
      choiceTextField.addActionListener(new ActionListener() {
	public void actionPerformed(ActionEvent e) {
		okCallback();
	}
      });
   mainPanel.setBorder(new EmptyBorder(5,5,5,5));

return mainPanel;
  }
 
源代码4 项目: darklaf   文件: DarkFileChooserUI.java
@Override
public void installComponents(final JFileChooser fc) {
    fc.setBorder(new EmptyBorder(10, 10, 7, 10));
    fc.setLayout(new BorderLayout(0, 7));
    filePane = createFilePane(fc);

    fc.add(createTopPanel(fc), BorderLayout.NORTH);
    fc.add(filePane, BorderLayout.CENTER);
    fc.add(createBottomPanel(fc), BorderLayout.SOUTH);
    fc.add(createControlPanel(fc), BorderLayout.AFTER_LINE_ENDS);

    setupButtonPanel(fc);
    if (fc.getControlButtonsAreShown()) {
        addControlButtons();
    }
    groupLabels(new AlignedLabel[]{fileNameLabel, filesOfTypeLabel});
}
 
源代码5 项目: FlatLaf   文件: FlatTaskPaneUI.java
@Override
protected void installDefaults() {
	if( group.getContentPane() instanceof JComponent ) {
		// remove default SwingX content border, which may be still set when switching LaF
		JComponent content = (JComponent) group.getContentPane();
		Border contentBorder = content.getBorder();
		if( contentBorder instanceof CompoundBorder &&
			((CompoundBorder)contentBorder).getOutsideBorder() instanceof BasicTaskPaneUI.ContentPaneBorder &&
			((CompoundBorder)contentBorder).getInsideBorder() instanceof EmptyBorder )
		{
			content.setBorder( null );
		}

		// set non-UIResource color to background to avoid that it is lost when switching LaF
		background = UIManager.getColor( "TaskPane.background" );
		Color bg = content.getBackground();
		if( bg == null || bg instanceof UIResource ) {
			content.setBackground( new Color( background.getRGB(), true ) );
		}
	}

	roundHeight = FlatUIUtils.getUIInt( "TaskPane.roundHeight", UIManager.getInt( "Component.arc" ) );

	super.installDefaults();
}
 
源代码6 项目: ghidra   文件: EditExternalLocationDialog.java
private JComponent buildMainPanel() {

		Border panelBorder = new EmptyBorder(5, 10, 5, 10);
		if (externalLocation != null) {
			extLocPanel = new EditExternalLocationPanel(externalLocation); // Edit
		}
		else {
			extLocPanel = new EditExternalLocationPanel(program, externalLibraryName); // Create
		}
		extLocPanel.setBorder(panelBorder);
		int panelHeight = (externalLocation != null) ? PREFERRED_EDIT_PANEL_HEIGHT
				: PREFERRED_CREATE_PANEL_HEIGHT;
		extLocPanel.setPreferredSize(new Dimension(PREFERRED_PANEL_WIDTH, panelHeight));

		JPanel workPanel = new JPanel(new BorderLayout());
		workPanel.add(extLocPanel, BorderLayout.CENTER);

		return workPanel;
	}
 
源代码7 项目: plugins   文件: SkillCalculatorPanel.java
SkillCalculatorPanel(SkillIconManager iconManager, Client client, SpriteManager spriteManager, ItemManager itemManager)
{
	super();
	getScrollPane().setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

	this.iconManager = iconManager;

	setBorder(new EmptyBorder(10, 10, 10, 10));
	setLayout(new GridBagLayout());

	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.weightx = 1;
	c.gridx = 0;
	c.gridy = 0;

	tabGroup = new MaterialTabGroup();
	tabGroup.setLayout(new GridLayout(0, 6, 7, 7));

	addCalculatorButtons();

	final UICalculatorInputArea uiInput = new UICalculatorInputArea();
	uiInput.setBorder(new EmptyBorder(15, 0, 15, 0));
	uiInput.setBackground(ColorScheme.DARK_GRAY_COLOR);
	uiCalculator = new SkillCalculator(client, uiInput, spriteManager, itemManager);

	add(tabGroup, c);
	c.gridy++;

	add(uiInput, c);
	c.gridy++;

	add(uiCalculator, c);
	c.gridy++;
}
 
源代码8 项目: plugins   文件: BookPanel.java
BookPanel(final Book b)
{
	setBorder(new EmptyBorder(3, 3, 3, 3));
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	GroupLayout layout = new GroupLayout(this);
	this.setLayout(layout);

	JLabel image = new JLabel();
	b.getIcon().addTo(image);
	JLabel name = new JLabel(b.getShortName());
	location.setFont(FontManager.getRunescapeSmallFont());

	layout.setVerticalGroup(layout.createParallelGroup()
		.addComponent(image)
		.addGroup(layout.createSequentialGroup()
			.addComponent(name)
			.addComponent(location)
		)
	);

	layout.setHorizontalGroup(layout.createSequentialGroup()
		.addComponent(image)
		.addGap(8)
		.addGroup(layout.createParallelGroup()
			.addComponent(name)
			.addComponent(location)
		)
	);

	// AWT's Z order is weird. This put image at the back of the stack
	setComponentZOrder(image, getComponentCount() - 1);
}
 
源代码9 项目: plugins   文件: KourendLibraryPanel.java
void init()
{
	setLayout(new BorderLayout(0, 5));
	setBorder(new EmptyBorder(10, 10, 10, 10));
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	JPanel books = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.weightx = 1;
	c.gridx = 0;
	c.gridy = 0;
	Stream.of(Book.values())
		.filter(b -> !b.isDarkManuscript())
		.filter(b -> !config.hideVarlamoreEnvoy() || b != Book.VARLAMORE_ENVOY)
		.sorted(Comparator.comparing(Book::getShortName))
		.forEach(b ->
		{
			BookPanel p = new BookPanel(b);
			bookPanels.put(b, p);
			books.add(p, c);
			c.gridy++;
		});

	JButton reset = new JButton("Reset", RESET_ICON);
	reset.setRolloverIcon(RESET_HOVER_ICON);
	reset.addActionListener(ev ->
	{
		library.reset();
		update();
	});

	add(reset, BorderLayout.NORTH);
	add(books, BorderLayout.CENTER);
	update();
}
 
protected TitledBorderUIResource getObject() {
    return new TitledBorderUIResource(
            new EmptyBorder(1, 2, 3, 4),
            "TITLE",
            TitledBorder.CENTER,
            TitledBorder.ABOVE_TOP,
            new Font("Serif", Font.ITALIC, 12),
            Color.RED);
}
 
源代码11 项目: dragonwell8_jdk   文件: Test7149090.java
public static void main(String[] args) throws Exception {
    for (UIManager.LookAndFeelInfo lookAndFeel : UIManager.getInstalledLookAndFeels()) {
        for (Object[] defaultTitlePosition : DEFAULT_TITLE_POSITIONS) {
            if (defaultTitlePosition[0].equals(lookAndFeel.getName())) {
                UIManager.setLookAndFeel(lookAndFeel.getClassName());

                final int expectedPosition = (Integer) defaultTitlePosition[1];

                SwingUtilities.invokeAndWait(new Runnable() {
                    @Override
                    public void run() {
                        List<TitledBorder> borders = new ArrayList<>();

                        borders.add(BorderFactory.createTitledBorder(new EmptyBorder(0, 0, 0, 0), "Title"));

                        try {
                            Method getPositionMethod = TitledBorder.class.getDeclaredMethod("getPosition");

                            getPositionMethod.setAccessible(true);

                            for (TitledBorder border : borders) {
                                int position = (Integer) getPositionMethod.invoke(border);

                                if (position != expectedPosition) {
                                    throw new RuntimeException("Invalid title position");
                                }
                            }
                        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
                            throw new RuntimeException(e);
                        }
                    }
                });

                System.out.println("Test passed for LookAndFeel " + lookAndFeel.getName());
            }
        }
    }
}
 
源代码12 项目: plugins   文件: GrandExchangeOffersPanel.java
GrandExchangeOffersPanel()
{
	setLayout(new BorderLayout());
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	constraints.fill = GridBagConstraints.HORIZONTAL;
	constraints.weightx = 1;
	constraints.gridx = 0;
	constraints.gridy = 0;

	/* This panel wraps the offers panel and limits its height */
	JPanel offersWrapper = new JPanel(new BorderLayout());
	offersWrapper.setBackground(ColorScheme.DARK_GRAY_COLOR);
	offersWrapper.add(offerPanel, BorderLayout.NORTH);

	offerPanel.setLayout(new GridBagLayout());
	offerPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
	offerPanel.setBackground(ColorScheme.DARK_GRAY_COLOR);

	/* This panel wraps the error panel and limits its height */
	JPanel errorWrapper = new JPanel(new BorderLayout());
	errorWrapper.setBackground(ColorScheme.DARK_GRAY_COLOR);
	/*  The error panel, this displays an error message */
	PluginErrorPanel errorPanel = new PluginErrorPanel();
	errorWrapper.add(errorPanel, BorderLayout.NORTH);

	errorPanel.setBorder(new EmptyBorder(50, 20, 20, 20));
	errorPanel.setContent("No offers detected", "No grand exchange offers were found on your account.");

	container.add(offersWrapper, OFFERS_PANEL);
	container.add(errorWrapper, ERROR_PANEL);

	add(container, BorderLayout.CENTER);

	resetOffers();
}
 
源代码13 项目: plugins   文件: ItemPanel.java
ItemPanel(ItemDefinition item, KitType kitType, AsyncBufferedImage icon)
{

	setBorder(new EmptyBorder(3, 3, 3, 3));
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	GroupLayout layout = new GroupLayout(this);
	this.setLayout(layout);

	JLabel name = new JLabel(item.getName());

	JLabel location = new JLabel(StringUtils.capitalize(kitType.toString().toLowerCase()));
	location.setFont(FontManager.getRunescapeSmallFont());

	JLabel imageLabel = new JLabel();
	icon.addTo(imageLabel);

	layout.setVerticalGroup(layout.createParallelGroup()
		.addComponent(imageLabel)
		.addGroup(layout.createSequentialGroup()
			.addComponent(name)
			.addComponent(location)
		)
	);

	layout.setHorizontalGroup(layout.createSequentialGroup()
		.addComponent(imageLabel)
		.addGap(8)
		.addGroup(layout.createParallelGroup()
			.addComponent(name)
			.addComponent(location)
		)
	);

	// AWT's Z order is weird. This put image at the back of the stack
	setComponentZOrder(imageLabel, getComponentCount() - 1);
}
 
源代码14 项目: dragonwell8_jdk   文件: Test7022041.java
/**
  * Check behaviour of method TitledBorder.getTitleFont()
  */
private static void checkTitleFont() {
    TitledBorder titledBorder = new TitledBorder(new EmptyBorder(1, 1, 1, 1));
    Font defaultFont = UIManager.getLookAndFeelDefaults().getFont("TitledBorder.font");
    Font titledBorderFont = titledBorder.getTitleFont();

    // check default configuration
    if (defaultFont == null) {
        if (titledBorderFont == null) {
            return;
        }
        else {
            throw new RuntimeException("TitledBorder default font should be null");
        }
    }
    if (!defaultFont.equals(titledBorderFont)) {
        throw new RuntimeException("L&F default font " + defaultFont.toString()
                                 + " differs from TitledBorder font " + titledBorderFont.toString());
    }

    // title font is explicitly specified
    Font font = new Font("Dialog", Font.PLAIN, 10);
    titledBorder.setTitleFont(font);
    if (!font.equals(titledBorder.getTitleFont())) {
        throw new RuntimeException("TitledBorder font should be " + font.toString());
    }

    // title Font is unspecified
    titledBorder.setTitleFont(null);
    if (!defaultFont.equals(titledBorder.getTitleFont())) {
        throw new RuntimeException("L&F default font " + defaultFont.toString()
                                 + " differs from TitledBorder font " + titledBorderFont.toString());
    }
}
 
源代码15 项目: plugins   文件: FeedPanel.java
FeedPanel(FeedConfig config, Supplier<FeedResult> feedSupplier)
{
	super(true);
	this.config = config;
	this.feedSupplier = feedSupplier;

	setBorder(new EmptyBorder(10, 10, 10, 10));
	setBackground(ColorScheme.DARK_GRAY_COLOR);
	setLayout(new GridLayout(0, 1, 0, 4));
}
 
源代码16 项目: plugins   文件: NotesPanel.java
private MaterialTab buildTab(int index)
{
	String name = String.valueOf(index + 1);
	NoteTab noteTab = new NoteTab(notesManager, index);

	MaterialTab materialTab = new MaterialTab(name, tabGroup, noteTab);
	materialTab.setPreferredSize(new Dimension(30, 27));
	materialTab.setName(name);

	final JMenuItem deleteMenuItem = new JMenuItem();
	deleteMenuItem.setText(String.format("Delete note %s", name));

	deleteMenuItem.addActionListener(e ->
	{
		if (JOptionPane.showConfirmDialog(ClientUI.getFrame(), String.format("Delete note page %s?", name), "Notes", YES_NO_OPTION) != YES_OPTION)
		{
			return;
		}
		try
		{
			notesManager.deletePage(index);
		}
		catch (DeleteOnlyPageException err)
		{
			SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(ClientUI.getFrame(),
				"Cannot delete the last page",
				"Notes", ERROR_MESSAGE));
		}
	});

	final JPopupMenu contextMenu = new JPopupMenu();
	contextMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
	contextMenu.add(deleteMenuItem);

	materialTab.setComponentPopupMenu(contextMenu);

	return materialTab;
}
 
源代码17 项目: plugins   文件: WorldTableRow.java
/**
 * Builds the players list field (containing the amount of players logged in that world).
 */
private JPanel buildPlayersField()
{
	JPanel column = new JPanel(new BorderLayout());
	column.setBorder(new EmptyBorder(0, 5, 0, 5));

	playerCountField = new JLabel(world.getPlayers() + "");
	playerCountField.setFont(FontManager.getRunescapeSmallFont());

	column.add(playerCountField, BorderLayout.WEST);

	return column;
}
 
源代码18 项目: TencentKona-8   文件: WindowsToolBarUI.java
protected Border createNonRolloverBorder() {
    if (XPStyle.getXP() != null) {
        return new EmptyBorder(3, 3, 3, 3);
    } else {
        return super.createNonRolloverBorder();
    }
}
 
源代码19 项目: ghidra   文件: EditStackReferencePanel.java
private void buildPanel() {
	setLayout(new PairLayout(10, 10, 160));
	setBorder(new EmptyBorder(0, 5, 5, 5));

	stackOffset = new JTextField();

	refTypes = new GhidraComboBox<>(STACK_REF_TYPES);

	add(new GLabel("Stack Offset:", SwingConstants.RIGHT));
	add(stackOffset);
	add(new GLabel("Ref-Type:", SwingConstants.RIGHT));
	add(refTypes);
}
 
源代码20 项目: plugins   文件: UpdatePanel.java
UpdatePanel(SuppliesTrackerPanel suppliesTrackerPanel)
{
	this.panel = suppliesTrackerPanel;
	setBorder(new EmptyBorder(6, 6, 6, 6));
	setBackground(ColorScheme.DARK_GRAY_COLOR);
	setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
	JEditorPane editorPane = new JEditorPane();
	editorPane.setEditable(false);
	java.net.URL helpURL = UpdatePanel.class.getResource(
		"Info.html");

	if (helpURL != null)
	{
		try
		{
			editorPane.setPage(helpURL);
		}
		catch (IOException e)
		{
			throw new IllegalStateException("File not found");
		}
	}

	JButton close = new JButton("Close info");
	close.addActionListener(e ->
	{
		this.setVisible(false);
		panel.updateOverall();
		panel.getInfo().setVisible(true);
		panel.getLogsContainer().setVisible(true);
	});
	this.add(close);
	this.add(editorPane);

}
 
源代码21 项目: dragonwell8_jdk   文件: bug6456844.java
public static void main(String[] args) {
    JEditorPane ep = new JEditorPane();
    ep.setContentType("text/html");
    ep.setText("<html><body>abc</body></html>");
    ep.setBorder(new EmptyBorder(20, 20, 20, 20));
    ep.setBounds(0, 0, 100, 100);

    JTextComponent.DropLocation location =
            (JTextComponent.DropLocation) SwingAccessor.getJTextComponentAccessor().dropLocationForPoint(ep,
                    new Point(0, 0));

    if (location.getBias() == null) {
        throw new RuntimeException("null bias");
    }
}
 
源代码22 项目: plugins   文件: TimeTrackingPanel.java
TimeTrackingPanel(ItemManager itemManager, TimeTrackingConfig config,
				FarmingTracker farmingTracker, BirdHouseTracker birdHouseTracker, ClockManager clockManager,
				FarmingContractManager farmingContractManager)
{
	super(false);

	this.itemManager = itemManager;
	this.config = config;

	setLayout(new BorderLayout());
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	display.setBorder(new EmptyBorder(10, 10, 8, 10));

	tabGroup.setLayout(new GridLayout(0, 6, 7, 7));
	tabGroup.setBorder(new EmptyBorder(10, 10, 0, 10));

	add(tabGroup, BorderLayout.NORTH);
	add(display, BorderLayout.CENTER);

	addTab(Tab.OVERVIEW, new OverviewTabPanel(itemManager, config, this, farmingTracker, birdHouseTracker, clockManager,
		farmingContractManager));
	addTab(Tab.CLOCK, clockManager.getClockTabPanel());
	addTab(Tab.BIRD_HOUSE, birdHouseTracker.createBirdHouseTabPanel());

	for (Tab tab : Tab.FARMING_TABS)
	{
		addTab(tab, farmingTracker.createTabPanel(tab, farmingContractManager));
	}
}
 
源代码23 项目: dragonwell8_jdk   文件: Test7022041.java
/**
  * Check behaviour of method TitledBorder.getTitleColor()
  */
private static void checkTitleColor() {
    TitledBorder titledBorder = new TitledBorder(new EmptyBorder(1, 1, 1, 1));
    Color defaultColor = UIManager.getLookAndFeelDefaults().getColor("TitledBorder.titleColor");
    Color titledBorderColor = titledBorder.getTitleColor();

    // check default configuration
    if (defaultColor == null) {
        if (titledBorderColor == null) {
            return;
        }
        else {
            throw new RuntimeException("TitledBorder default color should be null");
        }
    }
    if (!defaultColor.equals(titledBorderColor)) {
        throw new RuntimeException("L&F default color " + defaultColor.toString()
                                 + " differs from TitledBorder color " + titledBorderColor.toString());
    }

    // title color is explicitly specified
    Color color = Color.green;
    titledBorder.setTitleColor(color);
    if (!color.equals(titledBorder.getTitleColor())) {
        throw new RuntimeException("TitledBorder color should be " + color.toString());
    }

    // title color is unspecified
    titledBorder.setTitleColor(null);
    if (!defaultColor.equals(titledBorder.getTitleColor())) {
        throw new RuntimeException("L&F default color " + defaultColor.toString()
                                 + " differs from TitledBorder color " + titledBorderColor.toString());
    }
}
 
源代码24 项目: plugins   文件: ClockTabPanel.java
private JPanel createInfoPanel(String text)
{
	JPanel panel = new JPanel(new BorderLayout());
	panel.setBorder(new EmptyBorder(7, 8, 6, 8));
	panel.setBackground(ColorScheme.DARK_GRAY_COLOR);

	JLabel infoLabel = new JShadowedLabel(text);
	infoLabel.setForeground(ColorScheme.LIGHT_GRAY_COLOR.darker());
	infoLabel.setFont(FontManager.getRunescapeSmallFont());
	panel.add(infoLabel);

	return panel;
}
 
protected TitledBorder getObject() {
    return new TitledBorder(
            new EmptyBorder(1, 2, 3, 4),
            "TITLE",
            TitledBorder.CENTER,
            TitledBorder.ABOVE_TOP,
            new Font("Arial", Font.ITALIC, 12),
            Color.RED);
}
 
源代码26 项目: TencentKona-8   文件: PolicyTool.java
ToolDialog(String title, PolicyTool tool, ToolWindow tw, boolean modal) {
    super(tw, modal);
    setTitle(title);
    this.tool = tool;
    this.tw = tw;
    addWindowListener(new ChildWindowListener(this));

    // Create some space around components
    ((JPanel)getContentPane()).setBorder(new EmptyBorder(6, 6, 6, 6));
}
 
源代码27 项目: darklaf   文件: DarkSpinnerUI.java
@Override
protected Component createNextButton() {
    nextButton = createArrow(SwingConstants.NORTH);
    nextButton.setName("Spinner.nextButton");
    nextButton.setBorder(new EmptyBorder(1, 1, 1, 1));
    nextButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    installNextButtonListeners(nextButton);
    return nextButton;
}
 
源代码28 项目: darklaf   文件: DarkTabbedPopupUI.java
protected void setupTabbedPane() {
    label.setBorder(new EmptyBorder(0, 5, 0, 5));
    JPanelUIResource buttonHolder = new JPanelUIResource();
    buttonHolder.setLayout(new BoxLayout(buttonHolder, BoxLayout.X_AXIS));
    buttonHolder.add(Box.createHorizontalStrut(1));
    buttonHolder.add(closeButton);
    buttonHolder.add(Box.createHorizontalStrut(1));
    buttonHolder.setOpaque(false);
    tabbedPane.setOpaque(false);
    tabbedPane.putClientProperty("JTabbedPane.leadingComponent", label);
    tabbedPane.putClientProperty("JTabbedPane.trailingComponent", buttonHolder);
}
 
源代码29 项目: darklaf   文件: DarkPanelPopupUI.java
protected HeaderButton createCloseButton() {
    HeaderButton closeButton = new HeaderButton(UIManager.getIcon("TabFramePopup.close.icon"), this);
    closeButton.setBorder(new EmptyBorder(4, 4, 4, 4));
    closeButton.addActionListener(e -> popupComponent.close());
    String tooltip = ResourceUtil.getResourceBundle("actions", popupComponent).getString("Actions.close");
    tooltip = tooltip + " (" + UIManager.getString("TabFramePopup.closeTooltipTextHint") + ")";
    closeButton.setToolTipText(tooltip);
    return closeButton;
}
 
源代码30 项目: darklaf   文件: CreateUITable.java
private String parsePreview(final String key, final Object val, final int ident) {
    Object value = getValue(val);
    if (value instanceof Color) {
        return StringUtil.repeat(IDENT, ident)
               + String.format("<td style=\"background-color: #%s\" width=\"%d\" height=\"%d\">\n",
                               ColorUtil.toHex((Color) value), SAMPLE_WIDTH, SAMPLE_HEIGHT);
    } else if (value instanceof DarkSVGIcon) {
        return parseSVGIcon((DarkSVGIcon) value, ident);
    } else if ((value instanceof Border && !(value instanceof EmptyBorder))
               || value instanceof Font
               || (value instanceof Icon && !(value instanceof EmptyIcon))) {
        return parseImage(key, value, ident);
    }
    return StringUtil.repeat(IDENT, ident) + "<td></td>\n";
}
 
 类所在包
 类方法
 同包方法