Results 1 to 3 of 3
- 01-04-2011, 04:14 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 49
- Rep Power
- 0
\n not working in GUI (working code, but \n isn't working)
here is the code:
Java Code:import javax.swing.*; public class Creepster extends JFrame{ private String s; private JLabel label; public Creepster() { s = "Hello Mr. Creepster\nThis is my first Java program.\n"; s += "I wanted to show you that I am learning Java and to thank you for teaching me."; label = new JLabel(s); add(label); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); setVisible(true); } public static void main(String args[]) { new Creepster(); } }
Thanks,
cc11rocks
- 01-04-2011, 04:59 AM #2
Senior Member
- Join Date
- Dec 2010
- Posts
- 165
- Rep Power
- 11
Java Code:s = "<html>Hello Mr. Creepster<br>This is my first Java program.<br>"; s += "I wanted to show you that I am learning Java and to thank you for teaching me.</html>";
- 01-04-2011, 05:30 AM #3
Member
- Join Date
- Jan 2011
- Posts
- 49
- Rep Power
- 0
Similar Threads
-
Been working on a code for days
By Link01 in forum Java AppletsReplies: 5Last Post: 05-19-2010, 04:55 PM -
Why is the code not working
By sanox in forum New To JavaReplies: 12Last Post: 09-08-2009, 12:28 PM -
Next Page Code is not working
By Java.child in forum AWT / SwingReplies: 2Last Post: 02-18-2009, 06:26 PM -
JNI: Why this code not working?
By playwin2 in forum Advanced JavaReplies: 5Last Post: 11-25-2008, 02:12 PM -
Java mail problem(working in intranet,but not working in iternet)
By sundarjothi in forum Advanced JavaReplies: 8Last Post: 05-28-2008, 08:00 AM
Bookmarks