import java.awt.BorderLayout; import java.awt.Button; import java.awt.Dialog; import java.awt.FlowLayout; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Frame; import java.awt.GridLayout; import java.awt.Label; import java.awt.Panel; import java.awt.Rectangle; import java.awt.SystemColor; import java.awt.TextField; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class MyQuestions implements ActionListener { public final static int YES = 1; public final static int NO = -1; Frame parent; Font ftDialog; Dialog diDialog; Button btOK = new Button(); Button btCancel = new Button(); Panel pnButtons = new Panel(new FlowLayout(FlowLayout.RIGHT)); TextField tfInput = new TextField(); int maxWidth = 200; int result = 0; String userinput = null; WrapperDefs[] wd; public MyQuestions(Frame p, Font ft) { parent = p; ftDialog = ft; btOK.addActionListener(this); btCancel.addActionListener(this); wd = new WrapperDefs[3]; wd[0] = new WrapperDefs(" ", true); wd[1] = new WrapperDefs("\\", false, true); wd[2] = new WrapperDefs("-", false, false); } public MyQuestions(Frame p) { this(p, new Font("Dialog", Font.PLAIN, 8)); } private int getLastWrap(String text) { for (int i=text.length()-1;i>0;i--) { for (int j=0;j maxWidth && txts[i].indexOf(" ") != -1) { if (!addedLine) { tmps = new String[txts.length+1]; for (int j=0;j=txts.length) { tmps = new String[txts.length+1]; for (int j=0;j