本文整理了Java中javax.swing.JLabel.repaint()
方法的一些代码示例,展示了JLabel.repaint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.repaint()
方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:repaint
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void update(){
int w = image.getWidth();
int h = image.getHeight();
float wr = (float) cam.getWidth() / image.getWidth();
float hr = (float) cam.getHeight() / image.getHeight();
scene.updateGeometricState();
for (int y = 0; y < h; y++){
for (int x = 0; x < w; x++){
Vector2f v = new Vector2f(x * wr,y * hr);
Vector3f pos = cam.getWorldCoordinates(v, 0.0f);
Vector3f dir = cam.getWorldCoordinates(v, 0.3f);
dir.subtractLocal(pos).normalizeLocal();
Ray r = new Ray(pos, dir);
results.clear();
scene.collideWith(r, results);
if (results.size() > 0){
image.setRGB(x, h - y - 1, 0xFFFFFFFF);
}else{
image.setRGB(x, h - y - 1, 0xFF000000);
}
}
}
label.repaint();
}
代码示例来源:origin: geotools/geotools
/**
* Set the line color items to show the given color choice
*
* @param color current color
*/
private void setLineColorItems(Color color) {
if (color != null) {
lineColor = color;
lineColorIcon.setColor(color);
lineColorLabel.repaint();
}
}
代码示例来源:origin: geotools/geotools
/**
* Set the fill color items to show the given color choice
*
* @param color current color
*/
private void setFillColorItems(Color color) {
if (color != null) {
fillColor = color;
fillColorIcon.setColor(color);
fillColorLabel.repaint();
}
}
代码示例来源:origin: org.netbeans.api/org-openide-awt
@Override
public void actionPerformed(ActionEvent e) {
if (icons == null) {
icons = new ImageIcon[8];
for (int i = 0; i < 8; i++) {
icons[i] = ImageUtilities.loadImageIcon("org/openide/awt/resources/quicksearch/progress_" + i + ".png", false); //NOI18N
}
}
jLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 6));
jLabel.setIcon(icons[index]);
//mac os x
jLabel.repaint();
index = (index + 1) % 8;
}
});
代码示例来源:origin: stackoverflow.com
final JLabel label = new JLabel("some label with a nice text");
label.setBackground(Color.YELLOW);
MouseAdapter adapter = new MouseAdapter() {
/**
* @inherited <p>
*/
@Override
public void mouseEntered(MouseEvent e) {
label.setOpaque(true);
label.repaint();
}
/**
* @inherited <p>
*/
@Override
public void mouseExited(MouseEvent e) {
label.setOpaque(false);
label.repaint();
}
};
label.addMouseListener(adapter);
代码示例来源:origin: RaiMan/SikuliX2
private void myMouseDragged(MouseEvent e) {
if (getActiveSide() == ALL) {
if (SX.isNull(lastDrag)) {
dragStart = e;
}
dragCurrent = e;
content.repaint();
} else {
dragSelection(e);
}
lastDrag = e;
}
代码示例来源:origin: RaiMan/SikuliX2
content.repaint();
if (masking) {
mask = new Element(rect);
代码示例来源:origin: dboissier/mongo4idea
public JComponent initUi() {
myValueLabel = new JLabel() {
@Override
public String getText() {
return getCurrentText();
}
};
setDefaultForeground();
setFocusable(true);
setBorder(createUnfocusedBorder());
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
add(myValueLabel);
add(Box.createHorizontalStrut(GAP_BEFORE_ARROW));
add(new JLabel(AllIcons.Ide.Statusbar_arrows));
installChangeListener(() -> {
myValueLabel.revalidate();
myValueLabel.repaint();
});
showPopupMenuOnClick();
showPopupMenuFromKeyboard();
indicateHovering();
indicateFocusing();
return this;
}
代码示例来源:origin: org.swinglabs.swingx/swingx-all
@Override
public void repaint(int x, int y, int width, int height) {
if (!dontIgnoreRepaint) {
return;
}
super.repaint(x, y, width, height);
}
代码示例来源:origin: com.eas.platypus/platypus-js-grid
@Override
public void repaint(long tm) {
if (repaintable) {
super.repaint(tm);
}
}
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
@Override
public void repaint() {
if (!dontIgnoreRepaint) {
return;
}
super.repaint();
}
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
@Override
public void repaint(long tm, int x, int y, int width, int height) {
if (!dontIgnoreRepaint) {
return;
}
super.repaint(tm, x, y, width, height);
}
代码示例来源:origin: igniterealtime/Spark
public void setTitleColor(Color color) {
titleLabel.setForeground(color);
titleLabel.validate();
titleLabel.repaint();
}
代码示例来源:origin: jsettlers/settlers-remake
@Override
public void mouseEntered(MouseEvent e) {
clearIcon.setHover(true);
clearIconLabel.repaint();
}
代码示例来源:origin: jsettlers/settlers-remake
@Override
public void mouseExited(MouseEvent e) {
clearIcon.setHover(false);
clearIconLabel.repaint();
}
代码示例来源:origin: mucommander/mucommander
private void updatePreviewLabel() {
SimpleDateFormat dateFormat = new SimpleDateFormat(
getDateFormatString()
+" "+getTimeFormatString());
previewLabel.setText(dateFormat.format(exampleDate));
previewLabel.repaint();
}
代码示例来源:origin: net.imagej/imagej-ui-swing
@Override
public void doRefresh() {
ColorTable colorTable = getValue();
fillImage(colorTable);
picLabel.setIcon(new ImageIcon(image));
picLabel.repaint();
}
代码示例来源:origin: biojava/biojava
public void setStructure1(Structure structure){
this.structure1 = structure;
if ( structure != null) {
setAtoms(structure1,panel1);
label1.setText(structure.getPDBCode());
label1.repaint();
}
}
public void setStructure2(Structure structure){
代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun
public void highlightLabel(String searchText) {
LabelUI ui = getIconLabel().getUI();
if (ui instanceof HighlightingLabelUI) {
((HighlightingLabelUI)ui).setHighlightText(searchText);
getIconLabel().repaint();
}
}
代码示例来源:origin: igniterealtime/Spark
private void updateWithGenericInfo() {
String title = SparkManager.getUserManager().getUserNicknameFromJID(jid);
titleLabel.setText(title);
avatarLabel.setIcon(SparkRes.getImageIcon(SparkRes.DEFAULT_AVATAR_64x64_IMAGE));
avatarLabel.invalidate();
avatarLabel.validate();
avatarLabel.repaint();
invalidate();
validate();
repaint();
}
内容来源于网络,如有侵权,请联系作者删除!