-
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
b6aba0e
commit bc9dd1e
Showing
5 changed files
with
69 additions
and
46 deletions.
There are no files selected for viewing
26 changes: 0 additions & 26 deletions
26
src/main/java/team/elrant/bubbles/gui/ChatPageApplication.java
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
src/main/java/team/elrant/bubbles/gui/ChatViewApplication.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,48 @@ | ||
package team.elrant.bubbles.gui; | ||
|
||
import javafx.application.Application; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.Scene; | ||
import javafx.scene.layout.AnchorPane; | ||
import javafx.stage.Stage; | ||
import team.elrant.bubbles.xmpp.ConnectedUser; | ||
|
||
public class ChatViewApplication extends Application { | ||
private ConnectedUser connectedUser = null; | ||
private String contactJid = null; | ||
|
||
public ChatViewApplication(ConnectedUser connectedUser, String contactJid) { | ||
this.connectedUser = connectedUser; | ||
this.contactJid = contactJid; | ||
} | ||
|
||
@Override | ||
public void start(Stage primaryStage) throws Exception { | ||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ChatView.fxml")); | ||
|
||
// Set custom controller factory | ||
fxmlLoader.setControllerFactory(param -> { | ||
try { | ||
// Instantiate the controller with the required properties | ||
return new ChatViewController(connectedUser, contactJid); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
throw new RuntimeException(e); | ||
} | ||
}); | ||
|
||
AnchorPane root = fxmlLoader.load(); | ||
Scene scene = new Scene(root, 400, 800); | ||
|
||
primaryStage.setTitle("Chat"); | ||
primaryStage.setScene(scene); | ||
primaryStage.centerOnScreen(); | ||
primaryStage.setResizable(false); | ||
primaryStage.show(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
launch(args); | ||
} | ||
} | ||
|
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