Here you can find the source of getButtonAsLink(String text)
public static JButton getButtonAsLink(String text)
//package com.java2s; //License from project: Open Source License import javax.swing.*; import java.awt.*; public class Main { public static JButton getButtonAsLink(String text) { JButton button = new JButton(); //button.setText("<HTML><FONT color=\"#000099\"><U>"+text+"</U></FONT></HTML>"); button.setText(text);//from ww w .j a va2s. c o m button.setHorizontalAlignment(SwingConstants.RIGHT); button.setBorderPainted(false); button.setOpaque(true); button.setForeground(Color.BLUE); //button.setBackground(Color.WHITE); return button; } }