-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c48791
commit 904603e
Showing
4 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
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 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 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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/mirkoebert/simplejavaradioplayer/StatusLine.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.mirkoebert.simplejavaradioplayer; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import javax.swing.*; | ||
import java.util.Observable; | ||
import java.util.Observer; | ||
|
||
@Slf4j | ||
public class StatusLine extends JLabel implements Observer { | ||
|
||
|
||
public StatusLine() { | ||
super("Ready to play your favorite music.", SwingConstants.CENTER); | ||
} | ||
|
||
@Override | ||
public void update(Observable o, Object arg) { | ||
log.info("Set status: {}", arg); | ||
try { | ||
setText((String) arg); | ||
} catch (Exception e) { | ||
log.warn("Can't set status {}", arg, e); | ||
} | ||
} | ||
} |