Ich möchte JScrollPane mit geänderten Farben des Textes, Hintergrund in der Textbox und eigene Schriftart machen, aber meine Implementierung funktioniert nicht - Ich habe Standardform von JScrollPane (weißer Hintergrund, Standard schwarze Schrift) gesehen. Könnte mir jemand sagen, warum es nicht funktioniert und wie man es repariert?Wie kann ich die Farben des JScrollPane-Inhalts ändern?
public class TextField extends JFrame
{
\t public TextField()
\t {
\t \t JScrollPane scroll = new JScrollPane(new JTextArea(15, 45));
\t \t scroll.setPreferredSize(new Dimension(500, 300));
\t \t scroll.getViewport().setBackground(Color.BLUE);
\t \t scroll.getViewport().setForeground(Color.YELLOW);
\t \t
\t \t Font font = new Font("Dialog", Font.BOLD + Font.ITALIC, 14);
\t \t scroll.getViewport().setFont(font);
\t \t add(scroll);
\t \t pack();
\t }
}