本文整理了Java中javax.swing.JPanel.repaint()
方法的一些代码示例,展示了JPanel.repaint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPanel.repaint()
方法的具体详情如下:
包路径:javax.swing.JPanel
类名称:JPanel
方法名:repaint
暂无
代码示例来源:origin: jersey/jersey
private void runButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_runButtonActionPerformed
final Main.Config config = new Main.Config(uriField.getText(), syncRadio.isSelected(),
Integer.parseInt(requestCountField.getText()));
runButton.setEnabled(false);
finishStatusLabel.setText(" ");
successRateStatusLabel.setText(" ");
messagePanel.removeAll();
messagePanel.revalidate();
messagePanel.repaint();
Executors.newSingleThreadExecutor().submit(new Runnable() {
@Override
public void run() {
sendMessages(config);
}
});
}//GEN-LAST:event_runButtonActionPerformed
代码示例来源:origin: runelite/runelite
display.add(selectedTab.getContent());
display.revalidate();
display.repaint();
代码示例来源:origin: marytts/marytts
public void updateVoices(LanguageComponentDescription newLanguage, boolean forceUpdate) {
if (currentLanguage != null && currentLanguage.equals(newLanguage) && !forceUpdate) {
return;
}
currentLanguage = newLanguage;
List<VoiceComponentDescription> lVoices = getVoicesForLanguage(currentLanguage);
pVoices.removeAll();
for (ComponentDescription desc : lVoices) {
pVoices.add(new ShortDescriptionPanel(desc, null));
}
pVoices.add(Box.createVerticalGlue());
pVoices.repaint();
this.pack();
}
代码示例来源:origin: runelite/runelite
lapsContainer.add(createSmallLabel("" + (c.gridy + 1)), c);
lapsContainer.add(createSmallLabel(getFormattedDuration(lap - previousLap)), c);
lapsContainer.add(createSmallLabel(getFormattedDuration(lap)), c);
lapsContainer.revalidate();
lapsContainer.repaint();
代码示例来源:origin: marytts/marytts
public void updateVoices(LanguageComponentDescription newLanguage, boolean forceUpdate) {
if (currentLanguage != null && currentLanguage.equals(newLanguage) && !forceUpdate) {
return;
}
currentLanguage = newLanguage;
List<VoiceComponentDescription> lVoices = getVoicesForLanguage(currentLanguage);
pVoices.removeAll();
for (ComponentDescription desc : lVoices) {
pVoices.add(new ShortDescriptionPanel(desc, null));
}
pVoices.add(Box.createVerticalGlue());
pVoices.repaint();
this.pack();
}
代码示例来源:origin: runelite/runelite
/**
* Rebuilds all the boxes from scratch using existing listed records, depending on the grouping mode.
*/
private void rebuild()
{
logsContainer.removeAll();
boxes.clear();
int start = 0;
if (!groupLoot && records.size() > MAX_LOOT_BOXES)
{
start = records.size() - MAX_LOOT_BOXES;
}
for (int i = start; i < records.size(); i++)
{
buildBox(records.get(i));
}
boxes.forEach(LootTrackerBox::rebuild);
updateOverall();
logsContainer.revalidate();
logsContainer.repaint();
}
代码示例来源:origin: runelite/runelite
listContainer.add(row);
listContainer.revalidate();
listContainer.repaint();
代码示例来源:origin: runelite/runelite
viewControls.add(groupedLootBtn);
viewControls.add(singleLootBtn);
viewControls.add(viewHiddenBtn);
changeGrouping(true);
changeItemHiding(true);
updateOverall();
logsContainer.removeAll();
logsContainer.repaint();
代码示例来源:origin: libgdx/libgdx
public void setAtlas (TextureAtlas atlas) {
atlasPanel.clearSelection();
atlasPanel.setAtlas(atlas);
CustomCardLayout cardLayout = (CustomCardLayout)content.getLayout();
cardLayout.show(content, "atlas");
showGenerationPanel(false);
content.revalidate();
content.repaint();
revalidate();
repaint();
}
代码示例来源:origin: stackoverflow.com
JPanel contentPane = (JPanel) frame.getContentPane();
contentPane.removeAll();
contentPane.add(panel);
contentPane.revalidate();
contentPane.repaint();
代码示例来源:origin: kiegroup/optaplanner
public void addShiftAssignment(ShiftAssignment shiftAssignment) {
Shift shift = shiftAssignment.getShift();
JPanel shiftPanel = shiftPanelMap.get(shift);
JButton shiftAssignmentButton = SwingUtils.makeSmallButton(new JButton(new ShiftAssignmentAction(shiftAssignment)));
shiftAssignmentButton.setEnabled(shiftPanel.isEnabled());
if (employee != null) {
if (employee.getDayOffRequestMap().containsKey(shift.getShiftDate())
|| employee.getShiftOffRequestMap().containsKey(shift)) {
shiftAssignmentButton.setForeground(TangoColorFactory.SCARLET_1);
}
}
Color color = nurseRosteringPanel.determinePlanningEntityColor(shiftAssignment, shift.getShiftType());
shiftAssignmentButton.setBackground(color);
String toolTip = nurseRosteringPanel.determinePlanningEntityTooltip(shiftAssignment);
shiftAssignmentButton.setToolTipText(toolTip);
shiftPanel.add(shiftAssignmentButton);
shiftPanel.repaint();
shiftAssignmentButtonMap.put(shiftAssignment, shiftAssignmentButton);
}
代码示例来源:origin: libgdx/libgdx
public void setTexture(Texture texture){
texturePanel.clearSelection();
texturePanel.setTexture(texture);
CustomCardLayout cardLayout = (CustomCardLayout)content.getLayout();
cardLayout.show(content, "texture");
showGenerationPanel(true);
content.revalidate();
content.repaint();
revalidate();
repaint();
}
代码示例来源:origin: magefree/mage
/**
* Adds new arrow.
*
* @param startX
* @param startY
* @param endX
* @param endY
* @param color
*/
public void addArrow(UUID gameId, int startX, int startY, int endX, int endY, Color color, Type type) {
JPanel p = getArrowsPanel(gameId);
Arrow arrow = new Arrow();
arrow.setColor(color);
arrow.setArrowLocation(startX, startY, endX, endY);
arrow.setBounds(0, 0, Math.max(startX, endX) + 40, Math.max(startY, endY) + 30); // 30 is offset for arrow heads (being cut otherwise)
synchronized (map) {
p.add(arrow);
Map<Type, java.util.List<Arrow>> innerMap = map.computeIfAbsent(gameId, k -> new HashMap<>());
java.util.List<Arrow> arrows = innerMap.computeIfAbsent(type, k -> new ArrayList<>());
arrows.add(arrow);
}
p.revalidate();
p.repaint();
}
代码示例来源:origin: runelite/runelite
updateOverall();
logsContainer.remove(box);
logsContainer.repaint();
logsContainer.add(box, 0);
代码示例来源:origin: libgdx/libgdx
public void setAtlas (TextureAtlas atlas) {
atlasPanel.clearSelection();
atlasPanel.setAtlas(atlas);
CustomCardLayout cardLayout = (CustomCardLayout)content.getLayout();
cardLayout.show(content, "atlas");
showGenerationPanel(false);
content.revalidate();
content.repaint();
revalidate();
repaint();
}
代码示例来源:origin: magefree/mage
currentPanel.add(tab, JLayeredPane.DEFAULT_LAYER + count++, 0);
y += dy;
if (set.equals(currentSet)) {
jPanelLeft.revalidate();
jPanelLeft.repaint();
jPanelRight.revalidate();
jPanelRight.repaint();
if (currentTab != null) {
currentTab.drawSet();
代码示例来源:origin: runelite/runelite
slotContainer.add(imageLabel);
itemContainer.add(slotContainer);
itemContainer.repaint();
代码示例来源:origin: libgdx/libgdx
public void setTexture(Texture texture){
texturePanel.clearSelection();
texturePanel.setTexture(texture);
CustomCardLayout cardLayout = (CustomCardLayout)content.getLayout();
cardLayout.show(content, "texture");
showGenerationPanel(true);
content.revalidate();
content.repaint();
revalidate();
repaint();
}
代码示例来源:origin: stackoverflow.com
JPanel contentPane = (JPanel)displayFrames.get(f).getContentPane();
contentPane.add(new EnterPINPanel(), BorderLayout.CENTER);
contentPane.revalidate();
contentPane.repaint();
代码示例来源:origin: libgdx/libgdx
boolean previousSelected = renderGridCheckBox != null && renderGridCheckBox.isSelected();
renderGridCheckBox = new JCheckBox("Render Grid", previousSelected);
gridPanel.add(renderGridCheckBox, new GridBagConstraints());
addEditorRow(gridPanel);
for (Component component : rowsPanel.getComponents())
if (component instanceof EditorPanel) ((EditorPanel)component).update(ParticleEditor.this);
rowsPanel.repaint();
内容来源于网络,如有侵权,请联系作者删除!