This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void print(String tag, String message) { | |
AttributeSet as = StyleContext.getDefaultStyleContext().addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, foregroundColor); | |
try { | |
if (isTimestampEnabled) { | |
sdConsole.insertString(sdConsole.getLength(), "[" + timestampFormat.format(new Date()) + "] ", as); | |
} | |
sdConsole.insertString(sdConsole.getLength(), "[" , as); | |
for (int i=0;i<tag.length();i++) { | |
if (new Character(tag.charAt(i)).equals('\\')) { | |
i++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eJzNWMt247gR/aFZ5WSLhSVZtjuWrDE17TPZQWSJxBEIMCBoNf8+twDwJcuZWWYjE7cKr3rcKlhqf5D | |
55SW3RmyoJed/k3ehd9uS4B8e7GXrBf8ECRW7rq2ctbXA96rz3hoWrEiVNIqerA56LFnL3HetOGipgm | |
bcJqtcdxJvWn1SVGDR0RFpkp/UipWyNS2xAImVsxcy2qbTHZShPVGhhzkM3AjuTtxbV0u9ku4iPqwtN | |
vgYpgWQPwZwpVxeBTR8bawPx81ko5UpRbjLDOCpYjhHwsLEOD2gOBkOrGUYfVQk/XJUOtm2b4bWVtvO | |
iVdVVn60yUIj870m8eSSeSfZ8WrTbL7HnclQiJOfZR+vWR66urkoI9awekMuujwcVdYna/8fxhvlvOC | |
fEB1KayrG4RNfa4qdMLzr/SB5JVP6SrxaUwafGHvdOHWePMHIHaUbCJFtLitt84tYayyr8uCtEPsVtb | |
4VHwgAKibUybM/yhMs/yeFSFpZe2kr0hz5CXqXhbLD4Lg/xhDILp3WwYscs9amyIiJIpsJeUbKBKe+y | |
qKgmdq7VLq9GWL71kMJATBiG/KUeyyXIU3ClpkqTQPF8dDslxQo43rP0hTTvY4W8U6z7VZWTvNli+C1 | |
yJV3klq1XuUMb60riV3Q+iH/AnS0jXgxxU8yPoZB25BpZSXenJGelCm61jsldUzjFitnqqAknsCts8a | |
LR4RT21Ix4SvwoHgi6U7214QedAffJfsdpKH58lqBb5JC1mjp/0r25mCMnxKnjJd4wVkCxhYIcQniXA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thread t = null; | |
try { | |
final PipedOutputStream errOut = new PipedOutputStream(); | |
System.setErr(new PrintStream(errOut)); | |
final BufferedReader errIn = new BufferedReader(new InputStreamReader(new PipedInputStream(errOut))); | |
t = new Thread( | |
new Runnable() { | |
public void run() { | |
try { | |
this.wait(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void runPrinter() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
while (true) { | |
if (!JConsolePane.this.messages.isEmpty()) { | |
JConsolePane.this.print(JConsolePane.this.messages.get(0)); | |
JConsolePane.this.messages.remove(0); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This works. | |
new ServerHandler(WorldServer.this, WorldServer.this.listener.accept()); | |
//This does not. | |
new ServerHandler(WorldServer.this, WorldServer.this.listener.accept()).start(); | |
//Yes, ServerHandler implements Runnable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.out.println(text + System.getProperty("line.separator") + Thread.currentThread().getStackTrace()[stackDepth].getFileName() + ":" + Thread.currentThread().getStackTrace()[stackDepth].getLineNumber() + System.getProperty("line.separator") + Thread.currentThread().getStackTrace()[stackDepth].getClassName() + "." + Thread.currentThread().getStackTrace()[stackDepth].getMethodName()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initPrinter() { | |
new Thread(new Runnable() { public void run() {while (true) { | |
Message read = messageQueue.read(); | |
String text = read.getText(); | |
//process and print | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
}}}).start(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tpInput.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4), BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(consoleForeground), BorderFactory.createEmptyBorder(4, 4, 4, 4)))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<td valign="top" bgcolor="White" align="right"> | |
<a href="http://www.google.com/search?q=$query&tbm=shop&hl=en"> | |
<div style="background-color: #45a5ff; color: #ffffff; float: left; padding: 6px; font-weight:bold;">Compare Prices</div> | |
</a> | |
<!-- This should be placed directly before the <nobr> tag that wraps the price text in the variants table on product pages. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eJztWcly6zgS/KH+BRy0WLbeWLbaVD9Hzw0SSyRCIMEBQcucr58sANxkyuHo81xsMrOwFWqlpHZ7ebp | |
sT6YUL+Rysn/IWejN1CT4D7+8yNoJ/uMZSndNnVtjCoHnZeOcKZlYksqopwZ8JU+uqcVeS+Xf11STdU | |
lum6N41eqDggBTB0ukSX5QLZbKFDTFPCSW1lyo1Cbuba9KeiFKdTeGgRtiduCLsYXUS2kv4t2YdI2Hb | |
pgH+aEDl8qeco/6p7VxfruJrLQqM8FiGbZZjkAeLrq9RMwPDlN4FLvDprX0b+85SScSVVSa+vfMyrp+ | |
LWlltGmseFZZ7nrNTCQS12oSO0qnzOFq4lje5MxQCEyGLlW2b4rqokqxwpGqaA5hq7I4GsPvf9X0rnT | |
qZxB/k9dGDzx61K/lNzwhn5Vu9zIV77lyNGGinXiTmBCvH2S1bDfaXMlOBwYMZigOjVZVPcX/Jo3/Yo | |
l/UwL3coFCVN16g1TWCf7jzU1pjem619FZ+tdZc/LMM5WZy8WzKTN/waW5rq06u/6SGZkRuoHgKuVlq | |
c3pIlYa06pTr8dVTrWrxTusidIBtfLsDvKIa4yXsTTmUuek2ZUi9CZTZbqXw8shWFNyaaJ22AmMseIJ | |
ztb2Ux+srDzsEc8x/CzTlCIYJle6vnnFHmoHIZhUj63J0clhugTO59dNVFZWEOx3zpYWTa+f70mW6XC | |
4g4EH0Wi5pZHDeFnDGQy8742kVrVTJ4Y3xmbE91C7zqs9dDCV2JbpbypdsIW6orKWeYhXqkyb2lkldY |
OlderNewer