Java JButton Settings getButtonAsLink(String text)

Here you can find the source of getButtonAsLink(String text)

Description

get Button As Link

License

Open Source License

Declaration

public static JButton getButtonAsLink(String text) 

Method Source Code


//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;
    }
}

Related

  1. getAllButtons(Component topComponent)
  2. getbtnButton(String iconpath, String rolloverIconpath, String pressIconpath)
  3. getButton(Container c, String text)
  4. getButton(Container container, String text)
  5. getButton(String displayText, ActionListener actionListener)
  6. getButtonBorderColor(Color color)
  7. getButtonColor()
  8. getButtonPane()
  9. getButtonSelectColor()