kellan4459
IS-IT--Management
I have three classes (StatusBar, ImageGUI, ImageLoader)
the status bar class is nothing more than a JLabel that I instantiate in the ImageLoader class. In this class I update the text of the JLabel throughout the class. I then have my ImageGUI which has an instance of ImageLoader. I add the ImageLoader StatusBar to my GUI through a getStatusBar getter method in ImageLoader. It shows up with the instantiated text but the text doesn't change. It has been a while since I have worked with the Java GUI so I'm a little rusty. Does anyone see what I may be missing?
###STATUS BAR CLASS
public class StatusBar extends JLabel {
/** Creates a new instance of StatusBar */
public StatusBar() {
super();
this.setMessage("Ready");
}
public void setMessage(String message) {
this.setText(message);
}
}
###snippet where I add to my Frame in ImageGUI class
iu = new ImageLoader();
myPanel.add(iu.getStatusBar());
###snippet where I create then method where I set the text ###in ImageLoader class
public class ImageUploader {
private StatusBar sbPoint;
public ImageUploader(){
this.sbPoint = new StatusBar();
this.sbPoint.setMessage("Please select a directory to process");
}
public StatusBar getStatusBar(){
return this.sbPoint;
}
public void AddWatermark(String directoryPath,String imagePath, String watermarkPath) throws IOException {
this.getStatusBar().setMessage("creating WaterMark for "+imagePath);
}
}
the status bar class is nothing more than a JLabel that I instantiate in the ImageLoader class. In this class I update the text of the JLabel throughout the class. I then have my ImageGUI which has an instance of ImageLoader. I add the ImageLoader StatusBar to my GUI through a getStatusBar getter method in ImageLoader. It shows up with the instantiated text but the text doesn't change. It has been a while since I have worked with the Java GUI so I'm a little rusty. Does anyone see what I may be missing?
###STATUS BAR CLASS
public class StatusBar extends JLabel {
/** Creates a new instance of StatusBar */
public StatusBar() {
super();
this.setMessage("Ready");
}
public void setMessage(String message) {
this.setText(message);
}
}
###snippet where I add to my Frame in ImageGUI class
iu = new ImageLoader();
myPanel.add(iu.getStatusBar());
###snippet where I create then method where I set the text ###in ImageLoader class
public class ImageUploader {
private StatusBar sbPoint;
public ImageUploader(){
this.sbPoint = new StatusBar();
this.sbPoint.setMessage("Please select a directory to process");
}
public StatusBar getStatusBar(){
return this.sbPoint;
}
public void AddWatermark(String directoryPath,String imagePath, String watermarkPath) throws IOException {
this.getStatusBar().setMessage("creating WaterMark for "+imagePath);
}
}