Originally Posted by xcallmejudasx
|
|
Java 2 Platform SE 5.0 look at the getPath(), getHost() etc methods. I think those may be what you want
|
Thanks, I found the getCodeBase() that seems to be what I want.
*********************
Now I'm working with the interface, and I have a problem with the following code:
|
Code:
|
public class gallery{
JLabel title = new JLabel("Gallery");
public void show(){
contentPanel.removeAll();
contentPanel.add(title, BorderLayout.NORTH);
contentPanel.add(text, BorderLayout.CENTER);
}
}
public class uploader{
JLabel title = new JLabel("Uploader");
public void show(){
contentPanel.removeAll();
contentPanel.add(title, BorderLayout.NORTH);
contentPanel.add(text, BorderLayout.CENTER);
}
} |
I have two buttons, one for uploading and one for browsing. The event handlers for the buttons sets the JLabel text to a string returned from a php-page that returns time(), and calls uploader.show() resp. browser.show(), that clears the contentPanel and adds it's own content.
However, the JLabel title only changes the first time I press a button, if I first press the button "upload", the title changes to Uploader, and if I then press "Browse", the title changes to "Gallery". But after that, the title don't change anymore. But the JLabel text change each time I press a button.
How can this be?