Выглядит так:

После нескольких часов почесывания затылка я решил спросить у вас, ребята!
Код:
Код: Выделить всё
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.io.*;
import javax.swing.*;
public class JTask {
JButton button = new JButton();
JFrame frame = new JFrame();
JTextArea area = new JTextArea();
JScrollPane scrollPane = new JScrollPane();
JTask() throws IOException{
frame.setBounds(100, 100, 1000, 700);
frame.setLayout(null);
area.setFont(new Font("monospaced", Font.PLAIN, 14));
area.setBounds(5,25,972,500);
scrollPane.add(area);
scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setBounds(5,25,972,500);
scrollPane.setViewportView(area);
scrollPane.setEnabled(true);
scrollPane.setVisible(true);
scrollPane.repaint();
scrollPane.revalidate();
area.setVisible(true);
frame.add(scrollPane);
frame.add(area);
frame.setVisible(true);
try {
String line;
Process p = Runtime.getRuntime().exec(System.getenv("windir") +"\\system32\\"+"tasklist.exe");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
area.append(line);
area.append("\n");
}
input.close();
} catch (Exception e) {
e.printStackTrace();
}
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String args []) throws IOException{
JTask task = new JTask();
}
}
Подробнее здесь: https://stackoverflow.com/questions/248 ... -jtextarea