I am developing a small application in Java. On my UI i place a jPanel and put a JLabel in it. The size of panel grows and shrink according to my application window size.
Now i want to set the width of my JLabel to half of that JPanel. i.e my JLabel starts from beginning of that JPanel and goes to the middle of that JPanel. How should i achieve this?
Edit:
I also want to place another JLabel in front of the above JLabel which starts from the middle of JPanel and goes to the end of JPanel
Design some HTML that neatly divides the text into two halves – a table with one row and two cells would probably do the trick. Then stick that entire HTML into one label.