import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
+import javax.swing.JTextPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
+import javax.swing.text.JTextComponent;
import org.stackoverflowusers.file.WindowsShortcut;
int type, boolean scrollable, boolean modal)
{
nonBlockingDialog(32, 2, title, message, null, button, type, scrollable,
- modal);
+ false, modal);
}
public void nonBlockingDialog(int width, int height, String title,
String message, String boxtext, String button, int type,
- boolean scrollable, boolean modal)
+ boolean scrollable, boolean html, boolean modal)
{
if (type < 0)
{
}
JLabel jl = new JLabel(message);
- JTextArea jta = new JTextArea(height, width);
- // jta.setLineWrap(true);
- jta.setEditable(false);
- jta.setWrapStyleWord(true);
- jta.setAutoscrolls(true);
- jta.setText(boxtext);
+ JTextComponent jtc = null;
+ if (html)
+ {
+ JTextPane jtp = new JTextPane();
+ jtp.setContentType("text/html");
+ jtp.setEditable(false);
+ jtp.setAutoscrolls(true);
+ jtp.setText(boxtext);
+
+ jtc = jtp;
+ }
+ else
+ {
+ JTextArea jta = new JTextArea(height, width);
+ // jta.setLineWrap(true);
+ jta.setEditable(false);
+ jta.setWrapStyleWord(true);
+ jta.setAutoscrolls(true);
+ jta.setText(boxtext);
+
+ jtc = jta;
+ }
JScrollPane jsp = scrollable
- ? new JScrollPane(jta, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+ ? new JScrollPane(jtc, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)
: null;
}
else
{
- jta.setAlignmentX(Component.LEFT_ALIGNMENT);
- jp.add(jta);
+ jtc.setAlignmentX(Component.LEFT_ALIGNMENT);
+ jp.add(jtc);
}
}