IntelliJ 2020.1 JXDatePicker component alignment difference between IntelliJ Light, Dracula and Windows 10 light
Answered
I'm facing an alignment issue between different themes in IntelliJ IDEA 2020.1 version. Please find below screenshots.
IntelliJ IDEA 2020.1.2 - Window 10 Light theme (Intended behavior)

IntelliJ IDEA 2020.1.2 - IntelliJ Light theme

IntelliJ IDEA 2020.1.2 - Dracula theme

As you can see in the screenshots, both IntelliJ Light and Dracula rendered JXDatePicker slightly un-aligned with the other component. But this was not an issue for previous versions. Please find the sample code below.
JLabel lblSample = new JLabel();
lblSample.setText("Sample Component");
infoPanel.add(lblSample, ConstraintsFactory.getConstraintsAnchor(0, 3, GridBagConstraints.EAST));
ComboBox cmbSample = new ComboBox();
cmbSample.setPreferredSize(new Dimension(300, cmbSample.getPreferredSize().height));
cmbSample.setMinimumSize(new Dimension(300, cmbSample.getPreferredSize().height));
gbc = ConstraintsFactory.getConstraintsAnchor(1, 3, GridBagConstraints.WEST);
gbc.insets = new Insets(0, 5, 5, 5);
infoPanel.add(cmbSample, gbc);
JLabel lblDate = new JLabel();
lblDate.setText("Date");
infoPanel.add(lblDate, ConstraintsFactory.getConstraintsAnchor(0, 4, GridBagConstraints.EAST));
JXDatePicker datePicker = new JXDatePicker();
datePicker.setFormats("MM/dd/yyyy");
datePicker.setDate(new Date(System.currentTimeMillis()));
datePicker.getEditor().setEditable(false);
datePicker.setPreferredSize(new Dimension(300, datePicker.getPreferredSize().height));
datePicker.setMinimumSize(new Dimension(300, datePicker.getPreferredSize().height));
gbc = ConstraintsFactory.getConstraintsAnchor(1, 4, GridBagConstraints.WEST);
gbc.insets = new Insets(0, 5, 0, 0);
infoPanel.add(datePicker, gbc);
Please let me know your feedback on this.
Please sign in to leave a comment.
Hi. I filed a new issue: https://youtrack.jetbrains.com/issue/IDEA-244414
Please, vote and follow for updates. If you aren't familiar with YouTrack, see this instruction.