Noah | Nowipi
Noah | Nowipi
JCHJava Community | Help. Code. Learn.
Created by Noah | Nowipi on 12/28/2024 in #java-help
JavaFX UI won't update
public class BoardView extends GridPane {

private final BoardPresenter presenter;
private final SelectorView selector;

public BoardView() {
presenter = new BoardPresenter(this);
displayBoard(presenter.getBoard());
selector = new SelectorView(new SelectorPresenter());
presenter.selectionProperty().addListener((_, _, newValue) -> {
getChildren().remove(selector);
if (newValue == null)
return;
add(selector, newValue.x(), newValue.y());
});
}
public class BoardView extends GridPane {

private final BoardPresenter presenter;
private final SelectorView selector;

public BoardView() {
presenter = new BoardPresenter(this);
displayBoard(presenter.getBoard());
selector = new SelectorView(new SelectorPresenter());
presenter.selectionProperty().addListener((_, _, newValue) -> {
getChildren().remove(selector);
if (newValue == null)
return;
add(selector, newValue.x(), newValue.y());
});
}
The line getChildren().remove get's executed on the application thread and does remove the child. But the UI doesn't update/repaint because when I resize my window the selector disappears. When I run my app with debug the ui properly updates but when I don't run it with debug it doesn't
81 replies
JCHJava Community | Help. Code. Learn.
Created by Noah | Nowipi on 12/12/2024 in #java-help
Netty server and javafx services
Hi my server seems to stop without me telling it to 😦 The object of the Server class isn't getting garbage collected but it's channel does get magically stopped
18 replies
JCHJava Community | Help. Code. Learn.
Created by Noah | Nowipi on 11/12/2024 in #java-help
AWT window coordinate system
What coordinate system does awt use when you set a size of a frame? Does it use screen- or pixel coordinates? Because if I create a window of the same content size with glfw the glfw window is smaller. And yes I know that awt includes the decorations in the size of the window https://cdn.discordapp.com/attachments/680222311097303072/1305880569082806313/image.png?ex=6734a38d&is=6733520d&hm=08f1b2a5237f61e2a61bd2dedabd6d23350f0ee0d27de648e6f533e2d8f33ffc&
5 replies
JCHJava Community | Help. Code. Learn.
Created by Noah | Nowipi on 2/29/2024 in #java-help
PNG with white background but 0 alpha
Is it possible to create a png with a white background but 0 as the alpha value? Other pixels can have an alpha value greater than 0.
27 replies
JCHJava Community | Help. Code. Learn.
Created by Noah | Nowipi on 1/22/2024 in #java-help
Swing paint method not getting called
Sometimes when I run my application the paint method does not get called from the JPanel I set as my contentpane of my JFrame
14 replies
JCHJava Community | Help. Code. Learn.
Created by Noah | Nowipi on 4/13/2023 in #java-help
Implement interface from main in test
Hi, is it possible to do this? Or shouldn't/can't you do it? I use the standard maven file structure and am trying to implement an interface I declared in my main source code in my test code.
4 replies