Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Java Applet - displaying lots of text?

  • 31-01-2011 02:07PM
    #1
    Closed Accounts Posts: 27,856 ✭✭✭✭


    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, Registered Users 2 Posts: 211 ✭✭CrazyFish


    Use a JTextArea.


  • Registered Users, Registered Users 2 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