public static JXPanel getDescription(CardView card, int width, int height) { JXPanel descriptionPanel = new JXPanel(); //descriptionPanel.setAlpha(.8f); descriptionPanel.setBounds(0, 0, width, height); descriptionPanel.setVisible(false); descriptionPanel.setLayout(null); //descriptionPanel.setBorder(BorderFactory.createLineBorder(Color.green)); JButton j = new JButton(""); j.setBounds(0, 0, width, height); j.setBackground(Color.black); j.setLayout(null); JLabel cardText = new JLabel(); cardText.setBounds(5, 5, width - 10, height - 10); cardText.setForeground(Color.white); cardText.setFont(cardNameFont); cardText.setVerticalAlignment(SwingConstants.TOP); j.add(cardText); TextLines textLines = GuiDisplayUtil.getTextLinesfromCardView(card); cardText.setText(getRulefromCardView(card, textLines).toString()); descriptionPanel.add(j); return descriptionPanel; }
pluginBut = new JButton("Launchers..."); final JButton copyB = pluginBut; copyB.add(pluginPopup); pluginBut.addActionListener(new ActionListener() { @Override
JLabel iconLabel = new JLabel( "\uf0a8" ); iconLabel.setFont( fontAwesome ); JButton iconButton = new JButton( ); iconButton.add( iconLabel );
pluginBut = new JButton("Launchers..."); final JButton copyB = pluginBut; copyB.add(pluginPopup); pluginBut.addActionListener(new ActionListener() { @Override
JButton btn = new JButton(); btn.add(new JLabel(text)); btn.add(new JLabel(img)); btn.setLayout(/*best layout choice here*/); btn.setPreferredSize(new Dimension(x,y)); btn.setMaximumSize(new Dimension(maxX, minY)); btn.setMinimumSize(new Dimension(minX, minY)); //this one is most important when it comes to layoutmanagers
pluginBut = new JButton("Launchers..."); final JButton copyB = pluginBut; copyB.add(pluginPopup); pluginBut.addActionListener(new ActionListener() { @Override
JButton j1=new JButton("a"); j1.setLayout(null); j1.setBackground(Color.red); JButton j2=new JButton("b"); j2.setBackground(Color.yellow); j2.setBounds(100, 100, 50, 50); j1.add(j2); add(j1);
pluginBut = new JButton("Launchers..."); final JButton copyB = pluginBut; copyB.add(pluginPopup); pluginBut.addActionListener(new ActionListener() { @Override
m_templatesB.add(templatesMenu); templatesMenu.show(m_templatesB, 0, 0);
m_templatesB.add(templatesMenu); templatesMenu.show(m_templatesB, 0, 0);
popupMenu.add(menuItem); templatesB.add(popupMenu); popupMenu.show(templatesB, 0, 0);
popupMenu.add(menuItem); templatesB.add(popupMenu); popupMenu.show(templatesB, 0, 0);