Crea sito

Utilizzo del setEnabled(boolean)

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

class FinestraSwing
{
public static void main (String args[])
{
JFrame FrameObj=new JFrame();
JPanel PanelObj=new JPanel();
JLabel LabelObj=new JLabel("Test Bottone: ");
JButton ButtonObj=new JButton("OK");
PanelObj.add(LabelObj);
PanelObj.add(ButtonObj);
ButtonObj.setEnabled(false);
Container ContainerObj=FrameObj.getContentPane();
ContainerObj.add(PanelObj);
FrameObj.setSize(300,200);
FrameObj.setVisible(true);
}
}

<-Ritorna