Here you can find the source of makeIconButton(Icon icon, String tooltip)
public static JButton makeIconButton(Icon icon, String tooltip)
//package com.java2s; /*//ww w .ja v a2s. c o m * Copyright (c) 2015 IBM Corporation and others. * * Licensed under the Apache License, Version 2.0 (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import javax.swing.*; import java.awt.*; public class Main { public static final Color BLUE3 = new Color(0, 178, 239); public static final Color BLUE8 = new Color(0, 25, 52); private static final Font BIG = new Font("Inconsolata, Arial", Font.BOLD, 14); public static JButton makeIconButton(Icon icon, String tooltip) { JButton button = new JButton(icon); button.setToolTipText(tooltip); button.setBackground(BLUE8); button.setForeground(BLUE3); button.setBorder(BorderFactory.createMatteBorder(5, 5, 5, 5, new Color(0, 0, 0, 0))); button.setFont(BIG); return button; } }