ScrollPane doesn't work, why ??

From: javaSwing (frank.198233_at_gmail.com)
Date: 02/28/05

  • Next message: javaSwing: "Re: ScrollPane doesn't work, why ??"
    Date: 27 Feb 2005 23:26:19 -0800
    
    

    code snippet below

    class AA extends JPanel {
      public void paintComponent(Graphics g) {
        g.setColor(Color.yellow);
        g.fillRect(0, 0, 200, 200);
      }
    }

    public class B {
      public static void main(String[] args) {
        JFrame f = new JFrame();
        AA apanel = new AA();
        apanel.setPreferredSize(new Dimension(100, 100));
        // it seems scrollpane didnt work
        JScrollPane js = new JScrollPane(apanel);

        f.getContentPane().add(js);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      }
    }

    look at the jscrollpane, how to make it work in this situation ??


  • Next message: javaSwing: "Re: ScrollPane doesn't work, why ??"

    Relevant Pages

    • Re: Multithreading - writing to same file C#
      ... > to log the response of the DAL methods and log ... > public class yyy ... > private Mutex mut = new Mutex; ... > public static void Main ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Is it possible to "decipher" Java serialization data?
      ... that saved a class called "UserInfo". ... public class save { ... public static void main{ ... public String getUserName() { ...
      (comp.lang.java.programmer)
    • Re: Parse string expression and get result
      ... public class FuncEvalFactory ... public static IFuncEval Create(string expr) ... CompilerParameters param = new CompilerParameters; ... public static void Main ...
      (microsoft.public.dotnet.languages.csharp)
    • Spawned process output
      ... public static void main ... StreamConsumer errFromProcess ... public class StreamConsumer extends Thread ... while (!isDone) ...
      (comp.lang.java.programmer)
    • Re: Question:
      ... public static void main(Stringargs) ... //also there should be a boolean method ...
      (comp.lang.java.programmer)