javax.swing.JTextField.addMouseListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(225)

本文整理了Java中javax.swing.JTextField.addMouseListener()方法的一些代码示例,展示了JTextField.addMouseListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.addMouseListener()方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:addMouseListener

JTextField.addMouseListener介绍

暂无

代码示例

代码示例来源:origin: wiztools/rest-client

setLayout(new FlowLayout(FlowLayout.LEFT));
jtf_content_type_charset.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseClicked(MouseEvent e) {

代码示例来源:origin: wiztools/rest-client

jtf.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseClicked(MouseEvent e) {

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Adds the given tree to the display without removing already
 * displayed trees
 * @param match tree to be added
 */
private void addMatch(TreeFromFile match, List<Tree> matchedParts) {
 JPanel treeDisplay = new JPanel(new BorderLayout());
 JTextField filename = new JTextField("From file: " + match.getFilename());
 filename.setEditable(false);
 MouseInputAdapter listener = new FilenameMouseInputAdapter(filename);
 filename.addMouseListener(listener);
 filename.addMouseMotionListener(listener);
 treeDisplay.add(filename, BorderLayout.NORTH);
 if(TregexGUI.getInstance().isTdiffEnabled()) {
  tjp = getTreeJPanel(match.getDiffDecoratedTree(), matchedParts);
  tjp.setDiffConstituents(match.getDiffConstituents());
 } else {
  tjp = getTreeJPanel(match.getTree(), matchedParts);
 }
 matchedPartCoordinates = tjp.getMatchedPartCoordinates();
 matchedPartCoordinateIdx = -1;
 treeDisplay.add(tjp, BorderLayout.CENTER);
 filename.setOpaque(true);
 filename.setBackground(tjp.getBackground());
 filename.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
 scroller.setViewportView(treeDisplay);
 this.revalidate();
 this.repaint();
}

代码示例来源:origin: RipMeApp/ripme

ripTextfield.addMouseListener(new ContextMenuMouseListener());
ImageIcon ripIcon = new ImageIcon(mainIcon);
ripButton = new JButton("<html><font size=\"5\"><b>Rip</b></font></html>", ripIcon);

代码示例来源:origin: runelite/runelite

textField.addMouseListener(new MouseAdapter()

代码示例来源:origin: runelite/runelite

innerTxt.addMouseListener(hoverEffect);

代码示例来源:origin: tomighty/tomighty

filenameField.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseClicked(MouseEvent e) {

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void initBrowser(final Resolution resolution, final FileBrowserField fileBrowser) {
  fileBrowser.init(project, settingsController);
  fileBrowser.setSelectionListener(new Consumer<File>() {
    @Override
    public void consume(File file) {
      controller.addImage(file, resolution);
    }
  });
  fileBrowser.getTextField().addMouseListener(new SimpleMouseListener() {
    @Override
    public void mouseClicked(MouseEvent mouseEvent) {
      controller.setMostRecentImage(resolution);
    }
  });
}

代码示例来源:origin: Nilhcem/FakeSMTP

saveMsgField.addMouseListener(new MouseListener() {
  @Override
  public void mouseClicked(MouseEvent e) {

代码示例来源:origin: org.netbeans.api/org-openide-awt

txtLocation.addMouseListener(new MouseAdapter() {

代码示例来源:origin: stackoverflow.com

JTextField jtfSpinner = jspdeSpinner.getTextField();

jtfSpinner.addMouseListener(ml_maFragment);  //Work!
jtfSpinner.addMouseListener(ml_milFragment);  //Work!

代码示例来源:origin: stackoverflow.com

JTextField field = new JTextField();
ClipboardMenuHandler menuHandler = new ClipboardMenuHandler(field);
field.addMouseListener(menuHandler);

代码示例来源:origin: stackoverflow.com

final JTextField textField = new JTextField("Text goes here");
   textField.addMouseListener(new MouseAdapter(){
     @Override
     public void mouseClicked(MouseEvent e){
       //take some action here
     }
   });

代码示例来源:origin: stackoverflow.com

ComboBoxEditor editor = comboBox.getEditor();
JTextField textField = (JTextField)editor.getEditorComponent();
textField.addMouseListener(...);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-xml-xam-ui

/**
 * Creates new form SearchFieldPanel.
 */
public SearchFieldPanel() {
  initComponents();
  typesButton.addActionListener(this);
  searchTextField.addKeyListener(this);
  searchTextField.addActionListener(this);
  searchTextField.addFocusListener(this);
  searchTextField.addMouseListener(this);
  searchTextField.getDocument().addDocumentListener(this);
  typesPopupMenu.addPopupMenuListener(this);
  buttonProviderMap = new HashMap<String, SearchProvider>();
}

代码示例来源:origin: gaborbata/jpass

/**
 * Creates a new {@link JTextField} instance with a context pop-up menu by default.
 *
 * @param text the initial text
 * @return the new instance
 */
public static JTextField newTextField(String text) {
  JTextField textField = text == null ? new JTextField() : new JTextField(text);
  textField.addMouseListener(new TextComponentPopupListener());
  TextComponentActionType.bindAllActions(textField);
  return textField;
}

代码示例来源:origin: JGillam/burp-co2

PopupTextHelper(String[] options, JTextField target) {
  this.target = target;
  for (String option : options) {
    add(new PopupTextAction(option));
  }
  setInvoker(target);
  target.addMouseListener(this);
}

代码示例来源:origin: uk.org.mygrid.taverna/taverna-workbench

private JTextField getProjectSiteLabel() {
  final JTextField result=new JTextField("http://www.taverna.org.uk");
  result.setFocusable(true);
  result.setForeground(Color.BLUE);
  result.setBackground(BACKGROUND_COLOUR);
  result.setBorder(null);
  result.setEditable(false);
  result.setHorizontalAlignment(JTextField.CENTER);
  result.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      launchURL(result.getText());
    }
  });
  return result;
}

代码示例来源:origin: abc9070410/JComicDownloader

private JTextField getTextField( String string )
{
  //string = Common.getStringUsingDefaultLanguage( string ); // 使用預設語言 
  JTextField textField = new JTextField( string, 20 );
  textField.setFont( SetUp.getDefaultFont( -1 ) );
  textField.setHorizontalAlignment( JTextField.LEADING );
  if ( SetUp.getUsingBackgroundPicOfOptionFrame() )
  { // 若設定為透明,就用預定字體。
    textField.setOpaque( false );
    textField.setForeground( SetUp.getOptionFrameOtherDefaultColor() );
    textField.addMouseListener( this );
  }
  return textField;
}

代码示例来源:origin: Var3D/var3dframe

public void setSecureTextEntry(boolean isPasswordMode){
  JTextField newTextField=isPasswordMode?new JPasswordField():new JTextField();
  newTextField.setText(textField.getText());
  newTextField.setBounds(textField.getBounds());
  newTextField.setVisible(textField.isVisible());
  newTextField.setBackground(textField.getBackground());
  newTextField.setForeground(textField.getForeground());
  newTextField.setFont(textField.getFont());
  newTextField.setBorder(textField.getBorder());
  newTextField.setOpaque(textField.isOpaque());
  newTextField.addMouseListener(mouseListener);
  newTextField.addKeyListener(keyListener);
  newTextField.addFocusListener(focusListener);
  remove(textField);
  add(newTextField);
  textField=newTextField;
}

相关文章

JTextField类方法