
I added background color but I dont see textfields and labels anymore, please help. What am I missing?
(" JFrame f = new JFrame();
SchoolOption f1 = new SchoolOption();
Color c = new Color(128,0,0);
Container con = f.getContentPane();
con.setBackground(c);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(400, 120);
f.setTitle("Bloomfield College Student Registration System ");
f.setResizable(false);
f.setLocationRelativeTo(null);
f.setVisible(true);");

import java.awt.*;
import javax.swing.*;
class Test{
public static void main(String[] args){
JFrame f = new JFrame();
JLabel l1 = new JLabel("Name: ");
JTextField tf1 = new JTextField ();
f.setLayout(null);
l1.setBounds(10,10,100,20);
tf1.setBounds(120,10,120,20);
SchoolOption f1 = new SchoolOption();
f.add(l1);
f.add(tf1);
Color c = new Color(128,0,0);
Container con = f.getContentPane();
con.setBackground(c);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(400, 120);
f.setTitle("Bloomfield College Student Registration System");
f.setResizable(false);
f.setLocationRelativeTo(null);
f.setVisible(true);
l1.setVisible(true);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.