I'm trying to make a JFrame with a JProgressbar and a JButton inside, for the user to be see how far the process is and able to abort the process.
The only issue I seem to encounter, the progressbar and button components to always adjust to the JFrame size, and not the size I set them to. See picture one; Picture 1
The goal is to make it look like this example; Picture 2
Does anyone have some suggestions? See my code below;
JFrame f = new JFrame("Retrieve Datalog");
JButton b = new JButton("Abort");
JProgressBar progressBar = new JProgressBar();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setIconImage(ICONBAR.getImage());
f.setResizable(false);
f.setSize(300, 100);
f.setLocationRelativeTo(getFrame());
b.setSize(50, 10);
progressBar.setSize(f.getWidth() - 100, f.getHeight() - 50);
progressBar.setValue(50);
progressBar.setStringPainted(true);
f.add(progressBar, BorderLayout.NORTH);
f.add(b, BorderLayout.CENTER);
f.setVisible(true);
PS: I'm using NetBeans 8.1 IDE, JDK v8u91