Estoy acostumbrado a aprender programación muy rápido, aun por mi cuenta, sin embargo... Esto se me ha hecho cuesta arriba. El código es el siguiente:
Código HTML:
package Grafismo;
import java.awt.Color;
import java.awt.color.*;
import java.text.SimpleDateFormat;
import javax.swing.*;
import javax.swing.text.*;
public class Primera_interfaz_gráfica extends JPanel {
JEditorPane jeditor;
JTextField ftextfield;
JPasswordField jpass;
JFormattedTextField cp;
JFormattedTextField fecha;
JTextArea textArea;
public void TextExamples() {
initComponents();
}
private void initComponents() {
jeditor = new JEditorPane ("text/html", "<h1><b1> ¿Qué es la vida? </b> </h1>");
ftextfield = new JTextField ("Introduzca respuesta; 30");
this.add (jpass);
try {
cp = new JFormattedTextField(new MaskFormatter("#####"));
this.add(cp);
} catch (java.text.ParseException ex){
ex.printStackTrace();}
fecha = new JFormattedTextField (new SimpleDateFormat ("yyyy-MM-dd"));
fecha.setValue(new java.util.Date());
this.add(fecha);
textArea = new JTextArea (5,25);
this.add(textArea);
JTextPane textPane = new JTextPane ();
MutableAttributeSet attrs = textPane.getInputAttributes ();
StyleConstants.setFontFamily (attrs, "Seriff");
StyleConstants.setFontSize (attrs, 25);
StyleConstants.setItalic (attrs, true);
StyleConstants.setBold (attrs, true);
StyleConstants.setForeground (attrs, Color.blue);
StyledDocument doc = textPane.getStyledDocument ();
doc.setCharacterAttributes(0, doc.getLength() + 1, attrs, false);
textPane.setText ("Adios Mundo");
this.add(textPane);}
public static void main (String [] args){
Primera_interfaz_gráfica p = new Primera_interfaz_gráfica();
JFrame f = new JFrame();
f.getContentPane().add(p);
f.setSize(200,300);
p.setVisible(arg0);
f.setVisible(true);
}
}
Gracias por anticipado.


