diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/Console.java b/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/Console.java index a420e03..f987eba 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/Console.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/Console.java @@ -5,23 +5,21 @@ import net.knarcraft.minecraftserverlauncher.Main; import javax.swing.*; import javax.swing.text.DefaultCaret; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; +import java.awt.event.*; import java.util.ArrayList; import static javax.swing.text.DefaultCaret.ALWAYS_UPDATE; /** * Acts as a single writable/readable tab - * Has a box for user input, and a textArea for server output. + * + *
Has a box for user input, and a textArea for server output.
* * @author Kristian KnarvikThe tabbed pane used for displaying the console
+ * @param nameThe name of the console tab
+ */ Console(JTabbedPane tab, String name) { this.name = name; panel = new JPanel(); @@ -48,14 +52,19 @@ public class Console implements ActionListener, KeyListener { textInput.addKeyListener(this); } + /** + * Gets the JPanel this console is drawn on + * + * @returnThe JPanel this console is drawn on
+ */ public JPanel getPanel() { return this.panel; } /** - * Prints a string to the textArea. + * Prints a string to the console's output * - * @param text The text to print + * @param textThe string to print
*/ public void output(String text) { this.textOutput.setText(this.textOutput.getText() + "\n" + text); @@ -86,14 +95,6 @@ public class Console implements ActionListener, KeyListener { } } - @Override - public void keyReleased(KeyEvent e) { - } - - @Override - public void keyTyped(KeyEvent e) { - } - /** * Shows the previously executed command in the input field *