/******************** * 2004 Jalview Reengineered * Barton Group * Dundee University * * AM Waterhouse *******************/ package jalview.jbgui; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class GCutAndPasteTransfer extends JPanel { protected JTextArea textarea = new JTextArea(); protected JComboBox formatChoice = new JComboBox(); protected JLabel formatLabel = new JLabel(); protected JScrollPane scrollPane = new JScrollPane(); public GCutAndPasteTransfer() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { textarea.setFont(new java.awt.Font("Verdana", 0, 12)); textarea.setBorder(BorderFactory.createLineBorder(Color.black)); textarea.setText("Paste your alignment file here"); textarea.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(MouseEvent e) { textarea_mousePressed(e); } }); formatChoice.setFont(new java.awt.Font("Verdana", 0, 12)); formatChoice.setBounds(new Rectangle(194, 269, 159, 22)); formatChoice.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { formatChoice_actionPerformed(e); } }); formatLabel.setFont(new java.awt.Font("Verdana", 0, 12)); formatLabel.setHorizontalAlignment(SwingConstants.TRAILING); formatLabel.setText("Alignment Format"); formatLabel.setBounds(new Rectangle(76, 272, 110, 16)); this.setLayout(null); this.setPreferredSize(new Dimension(400, 300)); scrollPane.setBounds(new Rectangle(5, 5, 389, 256)); this.add(formatLabel, null); this.add(formatChoice, null); this.add(scrollPane, null); scrollPane.getViewport().add(textarea, null); } protected void formatChoice_actionPerformed(ActionEvent e) { } void textarea_mousePressed(MouseEvent e) { if(textarea.getText().equals("Paste your alignment file here")) textarea.setText(""); } }