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

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

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

JTextField.repaint介绍

暂无

代码示例

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

@Override
public void valueChanged(ListSelectionEvent arg0) {
 TreeFromFile t = (TreeFromFile) list.getSelectedValue();
 if(t == null) {
  lastSelected = null;
  return;
 }
 JTextField curSelected = t.getLabel();
 if(lastSelected != null) {
  if(lastSelected != curSelected) { //get rid of old highlights
   lastSelected.getHighlighter().removeAllHighlights();
   lastSelected = curSelected;
   firstMouseEvent = null;
   lastSelected.repaint();
  }
 } else
  lastSelected = curSelected;
}

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

@Override
public void mousePressed(MouseEvent e) {
 if (MatchesPanel.getInstance().isEmpty()) return;
 if(firstMouseEvent == null) {
  firstMouseEvent = e;
 }
 e.consume();
 if(((e.getModifiersEx()) & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) {
  //shift is being held
  addHighlight(textField, firstMouseEvent, e);
 } else if(!HighlightUtils.isInHighlight(e, textField, textField.getHighlighter())) {
  textField.getHighlighter().removeAllHighlights();
  firstMouseEvent = e;
  dragNDrop = false;
  textField.repaint();
 } else {
  //in a highlight, if we drag after this, we'll be DnDing
  dragNDrop = true;
 }
}

代码示例来源:origin: magefree/mage

public void handleKeyTyped(java.awt.event.KeyEvent evt) {
  if (evt.getKeyChar() == KeyEvent.VK_ENTER) {
    if (parentChatRef != null) {
      SessionHandler.sendChatMessage(parentChatRef.chatId, this.txtMessage.getText());
    } else {
      SessionHandler.sendChatMessage(chatId, this.txtMessage.getText());
    }
    this.txtMessage.setText("");
    this.txtMessage.repaint();
  }
}

代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor

protected void setFileNameField(String name) {
  fileNameField.setText(name);
  fileNameField.repaint();
}

代码示例来源:origin: sc.fiji/M_I_P

public void stateChanged( ChangeEvent e)
{
resizeBarField.setText(resizeBar.getValue() + "");
resizeBarField.repaint(); 
}
}

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

@Override
public void  mouseClicked(MouseEvent e){
  String cmd = textfield.getText();
  if ( cmd.equals(StructureAlignmentJmol.COMMAND_LINE_HELP)){
    textfield.setText("");
    textfield.repaint();
  }
};

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

@Override
  public void actionPerformed(ActionEvent evt) {
    // Perform action...
    final JFileChooser fc = new JFileChooser();

    //		In response to a button click:
    int returnVal = fc.showOpenDialog(null);
    if ( returnVal == JFileChooser.APPROVE_OPTION) {
      File file = fc.getSelectedFile();
      textField.setText(file.getAbsolutePath());
      textField.repaint();

    }

  }
}

代码示例来源:origin: nccgroup/AutoRepeater

@Override
public void insertUpdate(DocumentEvent e) {
 tabName.repaint();
 parent.validate();
}

代码示例来源:origin: com.jidesoft/jide-oss

@Override
public void repaint(long tm, int x, int y, int width, int height) {
  super.repaint(tm, x, y, width, height);
  OverlayableUtils.repaintOverlayable(this);
}

代码示例来源:origin: nccgroup/AutoRepeater

@Override
public void removeUpdate(DocumentEvent e) {
 tabName.repaint();
 parent.validate();
}

代码示例来源:origin: nccgroup/AutoRepeater

@Override
 public void changedUpdate(DocumentEvent e) {
  tabName.repaint();
  parent.validate();
 }
});

代码示例来源:origin: GrammarViz2/grammarviz2_src

@Override
 public void run() {
  dataFilePathField.setText((String) message.getPayload());
  dataFilePathField.repaint();
  disableAllButtons();
  selectFileButton.setEnabled(true);
  dataLoadButton.setEnabled(true);
 }
};

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (colorHexField.getBackground() != java.awt.Color.white)
  {
   colorHexField.setBackground(java.awt.Color.white);
   colorHexField.repaint();
  }
 }
});

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (fontSizeField.getBackground() != java.awt.Color.white)
  {
   fontSizeField.setBackground(java.awt.Color.white);
   fontSizeField.repaint();
  }
 }
});

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (nameField.getBackground() != java.awt.Color.white)
  {
   nameField.setBackground(java.awt.Color.white);
   nameField.repaint();
  }
 }
});

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (nameField.getBackground() != java.awt.Color.white)
  {
   nameField.setBackground(java.awt.Color.white);
   nameField.repaint();
  }
 }
});

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (valField.getBackground() != java.awt.Color.white)
  {
   valField.setBackground(java.awt.Color.white);
   valField.repaint();
  }
 }
});

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (valField.getBackground() != java.awt.Color.white)
  {
   valField.setBackground(java.awt.Color.white);
   valField.repaint();
  }
 }
});

代码示例来源:origin: google/sagetv

private void checkSolid()
 {
  if (fileField.getBackground() != java.awt.Color.white)
  {
   fileField.setBackground(java.awt.Color.white);
   fileField.repaint();
  }
 }
});

代码示例来源:origin: lbalazscs/Pixelitor

private void outputTypeChanged() {
  TweenOutputType selected = (TweenOutputType) outputTypeCB.getSelectedItem();
  if(selected.needsDirectory()) {
    browseFilesSupport.setSelectionMode(DIRECTORY);
    browseFilesSupport.setFileChooserTitle("Select Output Folder");
  } else {
    browseFilesSupport.setSelectionMode(FILE);
    browseFilesSupport.setFileChooserTitle("Select Output File");
    browseFilesSupport.setFileFilter(selected.getFileFilter());
  }
  if (fileNameTF != null) { // not the initial setup
    fileNameTF.repaint();
  }
}

相关文章

JTextField类方法