Como converter cores hexadecimais para inteiros

Observação no Java não tem uma função para cores hexadecimais, só existe cores para inteiras, então devemos converter as cores de hexadecimais para cores inteiras.

String hex = "#00FF00";
hex = hex.substring(1,7);
int xRGB = Integer.parseInt(hex, 16);
Color cor = new Color(xRGB);

Nome_do_botao.setBackground(cor);

Arquivo: JavaTeste.java

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class JavaTeste extends JFrame {

private JButton Nome_do_botao;

public JavaTeste() {

super("Formulario");
this.setSize(400,200);
this.setLocation(50, 100);

Container ct = this.getContentPane();
ct.setLayout(null);

Nome_do_botao = new JButton("Clique aqui");

String hex = "#00FF00";
hex = hex.substring(1,7);
int xRGB = Integer.parseInt(hex, 16);
Color cor = new Color(xRGB);

Nome_do_botao.setBackground(cor);

Nome_do_botao.setBounds(50,10,150,25);

ct.add(Nome_do_botao);

Image Icone = Toolkit.getDefaultToolkit().getImage("icon.gif");
setIconImage(Icone);

this.setVisible(true);

Nome_do_botao.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(Nome_do_botao.getText().equals("<html><font color='blue'>Teste 2</font></html>")){
Nome_do_botao.setText("<html><font color='red'>Teste 1</font></html>");
} else {
Nome_do_botao.setText("<html><font color='blue'>Teste 2</font></html>");
}
}});

this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}});

}
public static void main(String[] args) {
new JavaTeste();
}
}