1 Reply Latest reply: Oct 18, 2007 8:48 PM by 807600 RSS

    String question

    807600
      Hi, I was wondering how to display a string in a jPanel. I've tried using a JLabel, but I've been unsuccessful in printing out my line of string. This is one of my attempts:

      JLabel winnerText = new JLabel("Winner");
      winnerText.getText();

      I'm not really sure if this is the way to do it, but I couldn't find anything better in the java documentation.
        • 1. Re: String question
          807600
          Please ask swing related questions in the Swing forum. To answer this question you need to understand placing one component on another component, setting text,... What you really need to do is to go through the java swing tutorials. Otherwise you will be stumbling painfully from one question to another.