Skip to content

I don't understand how SwingTerminalFrame works #635

@ryuthegamerpup

Description

@ryuthegamerpup

This works:

public class Legendsdb {
 
    public static void main(String[] args) throws IOException {
        DefaultTerminalFactory dtf = new DefaultTerminalFactory();
        Terminal terminal = dtf.createTerminal();
        terminal.putCharacter('H');
        terminal.putCharacter('e');
        terminal.putCharacter('l');
        terminal.putCharacter('l');
        terminal.putCharacter('o');
        terminal.flush();
    }
}

This doesn't work:

public class Legendsdb {
 
    public static void main(String[] args) throws IOException {
        DefaultTerminalFactory dtf = new DefaultTerminalFactory();
        SwingTerminalFrame terminal = dtf.createSwingTerminal();
        // also happens with Terminal terminal = dtf.createSwingTerminal();
        terminal.putCharacter('H');
        terminal.putCharacter('e');
        terminal.putCharacter('l');
        terminal.putCharacter('l');
        terminal.putCharacter('o');
        terminal.flush();
    }
}

Returns:
Exception in thread "main" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions