Hello im making a game using an MVC layout and cannot get the JSlider to become visible. It's working an fully functional, but will not show unless the window is expanded. Here is my method that creates the JSlider in GameView: `public void startView() {
playerXPosition = 5; // Initializing the X position
playerYPosition = 80; // Initializing the Y position
score = 0;
tds = 0;
level = 1;
lives = 3;
MyPanel drawingWindow = new MyPanel();
drawingWindow.setSize(800, 500);
drawingWindow.setVisible(true);
this.add(drawingWindow);
SliderView jSlider = new SliderView();
jSlider.setSize(this.getWidth() / 4, 50);
jSlider.setAlignmentX((this.getWidth() / 2) - (this.getWidth() / 2));
jSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int tacklerspeed = jSlider.getValue();
getGameController().updateRatio(tacklerspeed);
System.out.println("Speed changed ");
System.out.println(tacklerspeed);
}
});
this.setSize(800, 700);
this.setVisible(true);
this.add(jSlider, BorderLayout.NORTH);
drawingWindow.setFocusable(true);
}`
And here's my SliderView class: `public class SliderView extends JSlider {
public SliderView() {
this.setEnabled(true);
this.setPaintTicks(true);
this.setMaximum(2);
this.setVisible(true);
this.setFocusable(false);
this.setValue(1);
this.setSnapToTicks(true);
}
}`