Barra de rolagem descer atomaticamente

1 resposta
albjava

Minha barra de rolagem preciso que ela de~sça automaticamente, fiz assim:

private void jbInit() throws Exception {
        this.setLayout(null);
        Logs.setText("Logs");
        Logs.setBounds(new Rectangle(23, 335, 34, 14));
        jLabel1.setText("Fila de Prontos");
        jLabel1.setBounds(new Rectangle(14, 21, 94, 14));
        jLabel2.setText("Fila de Bloqueados");
        jLabel2.setBounds(new Rectangle(252, 21, 103, 14));
        this.setPreferredSize(new Dimension(400, 600));
        this.setMinimumSize(new Dimension(500, 600));
        this.setResizable(false);
        figura.setLayout(null);
        scrolLogs.setVerticalScrollBarPolicy(JScrollPane.
                                             VERTICAL_SCROLLBAR_ALWAYS);
        scrolLogs.setAutoscrolls(true);
        scrolLogs.setBounds(new Rectangle(7, 357, 377, 145));
        figura.setBounds(new Rectangle(7, 277, 377, 58));
        scrollPane.setBounds(new Rectangle(7, 41, 161, 153));
        scrollPane1.setBounds(new Rectangle(248, 41, 136, 153));
        //executando.setText("textArea1");
        executando.setBounds(new Rectangle(61, 215, 264, 38));
        Executando.setText("Executando");
        //Executando.setText("lExecutando");
        Executando.setBounds(new Rectangle(77, 201, 161, 14));
        this.add(scrolLogs, null);
        this.add(Logs, null);
        this.add(figura, null);
        this.add(scrollPane1, null);
        this.add(jLabel2, null);
        this.add(jLabel1, null);
        this.add(scrollPane, null);
        this.add(executando);
        this.add(Executando);

    }

Mais não deu certo...
Please...Help....

1 Resposta

dudaskank

bem, vc pode ao colocar um texto novo fazer assim olha:

textArea.scrollRectToVisible(new Rectangle(0, textArea.getHeight(), 1, 1));
		textArea.repaint();

textArea é um JTextArea…

flw

Criado 13 de setembro de 2006
Ultima resposta 13 de set. de 2006
Respostas 1
Participantes 2