From 28989f2511733608fa044c201cb32e5175ba4d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Fri, 15 Jun 2012 01:05:03 +0200 Subject: [PATCH] hide the cursor --- src/de/ctdo/crashtest/gui/MainGui.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/de/ctdo/crashtest/gui/MainGui.java b/src/de/ctdo/crashtest/gui/MainGui.java index 5632760..ae6a915 100644 --- a/src/de/ctdo/crashtest/gui/MainGui.java +++ b/src/de/ctdo/crashtest/gui/MainGui.java @@ -3,6 +3,7 @@ package de.ctdo.crashtest.gui; import javax.swing.*; import java.awt.*; import java.awt.event.*; +import java.awt.image.BufferedImage; import java.util.*; import java.util.List; @@ -20,6 +21,11 @@ public class MainGui extends JFrame implements IGuiControl { setExtendedState(Frame.MAXIMIZED_BOTH); setUndecorated(true); + setCursor(getToolkit().createCustomCursor( new BufferedImage(3, 3, BufferedImage.TYPE_INT_ARGB), + new Point(0, 0), "null")); + textWall.setCursor(getToolkit().createCustomCursor( new BufferedImage(3, 3, BufferedImage.TYPE_INT_ARGB), + new Point(0, 0), "null")); + addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { @@ -34,7 +40,7 @@ public class MainGui extends JFrame implements IGuiControl { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { - for(GuiEventListener listener: listenerList) { + for (GuiEventListener listener : listenerList) { listener.windowClosing(); } } @@ -118,7 +124,8 @@ public class MainGui extends JFrame implements IGuiControl { final Runnable runnable = new Runnable() { @Override public void run() { - extraField.setText(text + " "); + String txt = text.substring(0, Math.min(text.length(), 8)); + extraField.setText(txt + " "); } };