How do I set two JLabels separated by a JTextField in the same line? I am using MigLayout. I have the following code
JPanel helper = new JPanel( new MigLayout() );
helper.add( new JLabel( "Threshold:" ), "" );
threshold = new JTextField();
Icon thresholdIcon = UIManager.getIcon( "OptionPane.questionIcon" );
JLabel thresholdIconLabel = new JLabel( thresholdIcon );
thresholdIconLabel.setToolTipText( "Threshold for template matching" );
helper.add( threshold, "wrap, width 100:20" );
helper.add( thresholdIconLabel, "wrap, width 100:20" );
The output that I get looks like the following.
I want the icon on the same line as Threshold and the text field. How should I adjust it? Any help/suggestions are appreciated.