-
- // Main panel
- JPanel mainPanel = new JPanel(new BorderLayout());
- JPanel mainPanelKeys = new JPanel();
- mainPanelKeys.setLayout(new BoxLayout(mainPanelKeys, BoxLayout.Y_AXIS));
- JPanel mainPanelValues = new JPanel();
- mainPanelValues.setLayout(new BoxLayout(mainPanelValues,
- BoxLayout.Y_AXIS));
-
- mainPanel.add(mainPanelKeys, BorderLayout.WEST);
- mainPanel.add(mainPanelValues, BorderLayout.CENTER);
-
- Map<String, String> desc = BasicReader.getMetaDesc(meta);
-
- Color trans = new Color(0, 0, 0, 1);
- for (String key : desc.keySet()) {
- JTextArea jKey = new JTextArea(key);
- jKey.setFont(new Font(jKey.getFont().getFontName(), Font.BOLD, jKey
- .getFont().getSize()));
- jKey.setEditable(false);
- jKey.setLineWrap(false);
- jKey.setBackground(trans);
- mainPanelKeys.add(jKey);
-
- JTextArea jValue = new JTextArea(desc.get(key));
- jValue.setEditable(false);
- jValue.setLineWrap(false);
- jValue.setBackground(trans);
- mainPanelValues.add(jValue);
- }
-
- // Image
- JLabel imgLabel = new JLabel(img);
- imgLabel.setVerticalAlignment(JLabel.TOP);
-
- // Borders
- mainPanelKeys.setBorder(BorderFactory.createEmptyBorder(top, space, 0,
- 0));
- mainPanelValues.setBorder(BorderFactory.createEmptyBorder(top, space,
- 0, 0));
- imgLabel.setBorder(BorderFactory.createEmptyBorder(0, space, 0, 0));
-
- // Add all
- add(imgLabel, BorderLayout.WEST);
- add(mainPanel, BorderLayout.CENTER);