mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 10:05:58 +01:00
[IMPL] path supports dir and files now
This commit is contained in:
21
src/main/java/config/CustomOutputStream.java
Normal file
21
src/main/java/config/CustomOutputStream.java
Normal file
@@ -0,0 +1,21 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user