Testing availability of your webserver from the Internet without NAT-loopback

•Mai 27, 2009 • Hinterlasse einen Kommentar

I wanted to test, wether my webserver is available from the Internet. But there was a little problem with the DSL-Router which doesn’t support NAT loopback.
I configured the Router with port-forwarding for port 80 to my webserver. When I tried to use the WAN IP of the Router in my Browser, I connected always to the configuration site of my router (which isn’t available from the Internet but inside the LAN. The problem is, that the Router finds „the other side“ (itself via the WAN-IP) but is then using a connection directly from the computer to the router without notice if the port-forwarding rule.
The workaround here is usage of one of the numerous free web proxies e.g. http://anonymouse.org/
Because the proxy starts his own request from the WAN side, the above effect does not occur.

Installing PHP5 with Apache webserver 2.2

•Mai 27, 2009 • Hinterlasse einen Kommentar

In this example, the php-installation is in C:\PHP, the Apache installation in C:\Program Files\Apache Software Foundation\Apache2.2

1. Copy php5apache2_2.dll to:
C:\Program Files\Apache Software Foundation\Apache2.2\modules
(or the equivalent directory for your installation)

2. Copy php5ts.dll to:
C:\Program Files\Apache Software Foundation\Apache2.2\bin
(or the equivalent directory for your installation)

3. Edit httpd.conf adding:
LoadModule php5_module modules/php5apache2_2.dll
AddType application/x-httpd-php .php
PHPIniDir „C:/PHP/“

The Number of JInternalFrames

•April 22, 2009 • Hinterlasse einen Kommentar

To get the number of the created JInternalFrames it is the easiest way to work with a static variable within a class extended from JInternalFrame:   


public class CompanyFrame extends javax.swing.JInternalFrame {
static int count; // the static counter
public CompanyFrame() { // constructor
count++;
// your code here
jLabel1.setText(String.valueOf(count));
}

Setting the System look and feel

•April 19, 2009 • Hinterlasse einen Kommentar

@Override protected void initialize(String[] args){
JFrame.setDefaultLookAndFeelDecorated(true);
try {
// Set System L&F
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException e) {
// handle exception
}
catch (ClassNotFoundException e) {
// handle exception
}
catch (InstantiationException e) {
// handle exception
}
catch (IllegalAccessException e) {
// handle exception
}

Substance look and feel with Swing Application Framework

•April 19, 2009 • Hinterlasse einen Kommentar

Both won’t work together if the laf-setting is not in the initialize()-Method. Used in this method, there will still be an error, but the laf will be set correctly.
@Override protected void initialize(String[] args){
JFrame.setDefaultLookAndFeelDecorated(true);
try {
UIManager.setLookAndFeel(new SubstanceChallengerDeepLookAndFeel());
} catch (Exception e) {
System.out.println(„Look and feel failed to initialize“);
}

ERROR:“Component creation must be done on Event Dispatch Thread“

 
Follow

Get every new post delivered to your Inbox.