import java.awt.*; import java.awt.event.*; import java.applet.*; import oracle.jdeveloper.layout.*; public class Monospace1 extends Applet { XYLayout xYLayout1 = new XYLayout(); boolean isStandalone = false; List list1 = new List(); Label label1 = new Label(); //Get a parameter value public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //Construct the applet public Monospace1() { } //Initialize the applet public void init() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { xYLayout1.setWidth(400); xYLayout1.setHeight(300); list1.setFont(new Font("Courier", 0, 12)); label1.setText("label1"); this.setLayout(xYLayout1); this.setBackground(SystemColor.control); this.add(list1, new XYConstraints(9, 23, 244, 140)); this.add(label1, new XYConstraints(5, 225, 288, -1)); list1.addItem("mmmm"); list1.addItem("iiii"); System.out.println(list1.getFont()); label1.setText(list1.getFont().toString()); } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } }