You should use:
label1.setHorizontalTextPosition(SwingConstants.LEFT);
(Set the position of the text, relative to the icon)
More Related Contents:
- Only one component shows up in JFrame
- How do I change JPanel inside a JFrame on the fly?
- JLabel – Show longer text as multiple lines?
- JPanel & components change position automatically
- How returns XxxSize from JComponent(s) added to the JLabel
- Does adding a JLabel to a JPanel “hide” the JPanel?
- Why is my JLabel not showing up
- FlowLayout on top of GridLayout not working
- .setBounds not working for JLabel and JButton
- Image resizing and displaying in a JPanel or a JLabel without loss of quality
- Update JLabel repeatedly with results of long running task
- JPanel repaint issue
- How to add hyperlink in JLabel?
- JLabel images array
- Eclipse WindowBuilder, overlapping JPanels
- How to draw in JPanel? (Swing/graphics Java)
- animate JPanel (slide in) with timer
- Sending messages between two JPanel objects
- Background image for a jPanel not working
- make a JLabel wrap it’s text by setting a max width
- How to remove gap in java swing label of large size
- Exporting a JPanel to an image
- Update a Label with a Swing Timer
- How to draw grid using swing class Java and detect mouse position when click and drag
- How to add JPanel by clicking JButton?
- How to include custom panel with NetBeans GUI Builder?
- Which Swing layout manager to get my desired layout?
- CardLayout showing two panels, flashing
- add JMenuBar to a JPanel?
- Customize JOptionPane Dialog