Untitled
unknown
plain_text
2 years ago
1.1 kB
6
Indexable
// Code adding the component to the parent container - not shown here
JLabel titleLabel = new javax.swing.JLabel();
titleLabel.setText("jLabel1");
titleLabel.setText(musical.getName());
musicalPanel.add(titleLabel);
musicalPanel.add(Box.createRigidArea(new Dimension(0, 10)));
JLabel descriptionLabel = new javax.swing.JLabel();
descriptionLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
descriptionLabel.setText("jLabel2");
descriptionLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
// Create a JLabel with text wrapping using HTML formatting
descriptionLabel.setText("<html>"+musical.getDescription()+"<html>");
musicalPanel.add(descriptionLabel);
musicalPanel.add(Box.createRigidArea(new Dimension(0, 10)));
ImagePanel img = new ImagePanel(musical.getName());
img.loadImageAsync(musical.getImageURL());
img.setSize(130, 170);
img.setPreferredSize(new Dimension(130,170));
img.setMaximumSize(new Dimension(130,170));
img.setMinimumSize(new Dimension(130,170));
img.setAlignmentX(Component.LEFT_ALIGNMENT);
musicalPanel.add(img);Editor is loading...
Leave a Comment