“One UI to control them all.” A sleek Java‑Swing application illustrating the Bridge Pattern in action—switch seamlessly between TV and Media Player remotes, full‑screen GIF animations included!
project-root/
├─ src/
│ ├─ main/
│ │ ├─ java/
│ │ │ ├ BasicRemoteGUI.java
│ │ │ └ AdvanceRemoteGUI.java
│ │ └─ resources/
│ │ ├ tv.gif
│ │ ├ player.gif
│ │ └ off.png
└─ README.md
- Choose between TV Remote and Player Remote
- Full‑screen animated GIF shows “TV ON” (blue video) or “Player ON” (rock‑video loop)
- Power button toggles ON/OFF—OFF shows your custom
off.pngscreen - Menu → Switch Remotes lets you swap devices anytime
- Bridge Pattern: Decouples Remotes (abstractions) from Devices (implementations)
- Dynamic UI: Nimbus Look & Feel + full‑screen support
- Rich Media: Animated GIFs for “ON” states, custom image for “OFF”
- Hot‑swap: Change your remote at any time via the menu
The Bridge Pattern separates an abstraction from its implementation, so the two can vary independently.
-
Abstraction
abstract class RemoteNewKnows only about theDeviceNewinterface, not concrete devices -
Refined Abstraction
class BasicRemoteNew extends RemoteNewImplements high–level controls (switchPower()) -
Implementor Interface
interface DeviceNewDeclareson(),off(),isEnabled() -
Concrete Implementors
class TvNew implements DeviceNewclass PlayerNew implements DeviceNewHandle device–specific behavior
-
Clone this repo
-
Open in IntelliJ IDEA (or any Java IDE)
-
Ensure Java 11+ is on your path
-
Run either:
mvn compile exec:java -Dexec.mainClass="BasicRemoteGUI"
or:
mvn compile exec:java -Dexec.mainClass="AdvanceRemoteGUI"- Enjoy your super‑powered remote!
- 🎨 Add custom skins for remotes
- 🎮 Expand to Volume, Channel, and Playlist controls
- 🚀 Package as a native installer with bundled JRE
MIT © \ Tharindu Chanaka Feel free to remix and extend!


