Hello Members,
If possible, kindly let me know why I am not able to see the text in the buttons("Button" and "Button two!") when I run this Java program:
import java.awt.*;
import javax.swing.*;
public class Sample extends JFrame {
private JButton b1, b2;
private final Container container;
public Sample()
{
b1 = new JButton ("Button");
b2 = new JButton ("Button two!");
container = getContentPane();
container.setLayout(null);
container.add(b1);
container.add(b2);
b1.setBounds(50, 50, 50, 50);
b2.setBounds(50, 125, 50, 50);
setSize(500, 500);
setVisible(true);
}
public static void main (String args[])
{
Sample sample = new Sample();
}
}
Thank you!!