mirror of
https://github.com/Akomry/sae302_applicom.git
synced 2025-12-06 11:43:53 +00:00
feat(graphique): Ajout logger, logging.properties, fonction initialize
This commit is contained in:
parent
8360fd9982
commit
6d8ec5b7f5
5 changed files with 55 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
module rtgre.chat {
|
||||
requires javafx.controls;
|
||||
requires javafx.fxml;
|
||||
requires java.logging;
|
||||
|
||||
|
||||
opens rtgre.chat to javafx.fxml;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,26 @@ import javafx.scene.Scene;
|
|||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class ChatApplication extends Application {
|
||||
public static final Logger LOGGER = Logger.getLogger(ChatApplication.class.getCanonicalName());
|
||||
public class EssaiLogger {
|
||||
/* . . . */
|
||||
static {
|
||||
try {
|
||||
InputStream is = EssaiLogger.class.getClassLoader()
|
||||
.getResource("logging.properties").openStream();
|
||||
LogManager.getLogManager().readConfiguration(is);
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(Level.INFO, "Cannot read configuration file", e);
|
||||
}
|
||||
}
|
||||
/* . . . */
|
||||
}
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(ChatApplication.class.getResource("chat-view.fxml"));
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
package rtgre.chat;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.image.ImageView;
|
||||
|
||||
public class ChatController {
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static rtgre.chat.ChatApplication.LOGGER;
|
||||
public class ChatController implements Initializable {
|
||||
|
||||
public MenuItem hostAddMenuItem;
|
||||
public MenuItem avatarMenuItem;
|
||||
|
|
@ -20,4 +25,8 @@ public class ChatController {
|
|||
public ListView contactListView;
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
LOGGER.info("Initialisation de l'interface graphique");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue