Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/03/2010, 05:22
flashtkd
 
Fecha de Ingreso: agosto-2008
Mensajes: 587
Antigüedad: 15 años, 8 meses
Puntos: 6
desplegar menu con click derecho JTextfield

hago click derecho en el JTextfield, pero no se depliega el menu de copiar, pegar, eliminar, como lo puede agregar o activar ese menu.

http://i48.tinypic.com/vwy9et.png

este es el formulario:

http://i45.tinypic.com/dgs8xc.png

Código Java SE:
Ver original
  1. public class NewJFrame extends javax.swing.JFrame {
  2.  
  3.     /** Creates new form NewJFrame */
  4.     public NewJFrame() {
  5.         initComponents();
  6.     }
  7.  
  8.     /** This method is called from within the constructor to
  9.      * initialize the form.
  10.      * WARNING: Do NOT modify this code. The content of this method is
  11.      * always regenerated by the Form Editor.
  12.      */
  13.     @SuppressWarnings("unchecked")
  14.     // <editor-fold defaultstate="collapsed" desc="Generated Code">
  15.     private void initComponents() {
  16.  
  17.         jTextField1 = new javax.swing.JTextField();
  18.  
  19.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  20.  
  21.         jTextField1.setText("Hola mundo");
  22.  
  23.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  24.         getContentPane().setLayout(layout);
  25.         layout.setHorizontalGroup(
  26.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  27.             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  28.                 .addContainerGap(33, Short.MAX_VALUE)
  29.                 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
  30.                 .addGap(27, 27, 27))
  31.         );
  32.         layout.setVerticalGroup(
  33.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  34.             .addGroup(layout.createSequentialGroup()
  35.                 .addGap(38, 38, 38)
  36.                 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  37.                 .addContainerGap(60, Short.MAX_VALUE))
  38.         );
  39.  
  40.         pack();
  41.     }// </editor-fold>
  42.  
  43.     /**
  44.     * @param args the command line arguments
  45.     */
  46.     public static void main(String args[]) {
  47.         java.awt.EventQueue.invokeLater(new Runnable() {
  48.             public void run() {
  49.                 new NewJFrame().setVisible(true);
  50.             }
  51.         });
  52.     }
  53.  
  54.     // Variables declaration - do not modify
  55.     private javax.swing.JTextField jTextField1;
  56.     // End of variables declaration
  57.  
  58. }