Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java Applet - displaying lots of text?

Options
  • 31-01-2011 3:07pm
    #1
    Closed Accounts Posts: 27,857 ✭✭✭✭


    Hey there,

    I've got a java program that I want to put online, and it displays lots of text output (after creating a bunch of objects and messing around with them). I had thought that applets were simply a case of embedding them with the <applet> tag, but alas, I have to do even more tinkering :p

    Anywho, it seems System.out.print/ln doesn't work in applets, so what's the best way to display lots of text in a similar manner? The output will be something like:
    Ace of Clubs
    2 of Hearts
    5 of Spades
    9 of Hearts
    Jack of Clubs

    Ace of Clubs
    6 of Hearts
    9 of Spades
    10 of Hearts
    King of Clubs

    Ace of Clubs
    Ace of Hearts
    2 of Spades
    8 of Hearts
    Queen of Clubs

    Pair: 1
    Two pair: 0
    ...
    etc

    I've been googling, and most of the solutions seem to be more suitable for short bits of text and graphical stuff. I just want a text output with no graphical mumbo jumbo :)

    Cheers


Comments

  • Registered Users Posts: 211 ✭✭CrazyFish


    Use a JTextArea.


  • Registered Users Posts: 539 ✭✭✭but43r


    Have you got your Java class extending JApplet?
    public class DemoJApplet extends JApplet
    
    

    You know that it's not just the matter of using <applet> tag to embed application in HTML document???
    You have to extend JApplet and have init() method implemented...


Advertisement