mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
22 lines
567 B
Java
22 lines
567 B
Java
package config;
|
|
|
|
import javax.swing.*;
|
|
import java.io.IOException;
|
|
import java.io.OutputStream;
|
|
|
|
public class CustomOutputStream extends OutputStream {
|
|
private JTextArea textArea;
|
|
|
|
public CustomOutputStream(JTextArea textArea) {
|
|
this.textArea = textArea;
|
|
}
|
|
|
|
@Override
|
|
public void write(int b) throws IOException {
|
|
// redirects data to the text area
|
|
textArea.append(String.valueOf((char) b));
|
|
// scrolls the text area to the end of data
|
|
textArea.setCaretPosition(textArea.getDocument().getLength());
|
|
}
|
|
}
|