javax.swing.JComponent.validate()方法的使用及代码示例

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

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

JComponent.validate介绍

暂无

代码示例

代码示例来源:origin: apache/pdfbox

public void changeData(byte[] bytes)
{
  if (mainPane.getComponentCount() > 0)
  {
    mainPane.removeAll();
  }
  HexModel model = new HexModel(bytes);
  mainPane.add(new HexEditor(model));
  mainPane.validate();
}

代码示例来源:origin: apache/pdfbox

@Override
  public void actionPerformed(ActionEvent e)
  {
    if (showingDetails)
    {
      main.remove(details);
      main.validate();
      main.setPreferredSize(MESSAGE_SIZE);
    }
    else
    {
      if (details == null)
      {
        details = createDetailedMessage(error);
        StringBuilder buffer = new StringBuilder();
        stacktrace.setText(generateStackTrace(error, buffer).toString());
        stacktrace.setCaretPosition(0);
        stacktrace.setBackground(main.getBackground());
        stacktrace.setPreferredSize(STACKTRACE_SIZE);
      }
      main.add(details, BorderLayout.CENTER);
      main.validate();
      main.setPreferredSize(TOTAL_SIZE);
    }
    showingDetails = !showingDetails;
    showDetails.setText(showingDetails ? "<< Hide Details" : "Show Details >>");
    ErrorDialog.this.pack();
  }
});

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

public void validate() {
  if (!tableUI) {
    super.validate();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public void validate() {
  if (!tableUI) {
    super.validate();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public void validate() {
  if (!tableUI) {
    super.validate();
  }
}

代码示例来源:origin: com.cedarsoft.commons/swing-presenter

protected boolean addChild( @NotNull T presentation, int index, @NotNull JComponent childPresentation ) {
 presentation.add( childPresentation, index );
 presentation.validate();
 return true;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
  * Sets the y coordinate of this bean
  * 
  * @param newY an <code>int</code> value
  */
 public void setY(int newY) {
  m_y = newY;
  ((JComponent) m_bean).setLocation(m_x, m_y);
  ((JComponent) m_bean).validate();
 }
}

代码示例来源:origin: brandonborkholder/glg2d

@Override
 public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
  comp.setSize(width, height);
  comp.validate();
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
  * Sets the y coordinate of this bean
  * 
  * @param newY an <code>int</code> value
  */
 public void setY(int newY) {
  m_y = newY;
  ((JComponent) m_bean).setLocation(m_x, m_y);
  ((JComponent) m_bean).validate();
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Sets the x coordinate of this bean
 * 
 * @param newX an <code>int</code> value
 */
public void setX(int newX) {
 m_x = newX;
 ((JComponent) m_bean).setLocation(m_x, m_y);
 ((JComponent) m_bean).validate();
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
  boolean didResize = (f.getWidth() != newWidth || f.getHeight() != newHeight);
  f.setBounds(newX, newY, newWidth, newHeight);
  if (didResize) {
    f.validate();
  }
}

代码示例来源:origin: com.cedarsoft.commons/swing-presenter

@Override
protected void removeChildPresentation( @NotNull T presentation, @NotNull StructPart child, int index ) {
 presentation.remove( index );
 presentation.validate();
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Sets the x coordinate of this bean
 * 
 * @param newX an <code>int</code> value
 */
public void setX(int newX) {
 m_x = newX;
 ((JComponent) m_bean).setLocation(m_x, m_y);
 ((JComponent) m_bean).validate();
}

代码示例来源:origin: Killerardvark/CryodexSource

public static void repaint(JComponent comp) {
    comp.validate();
    comp.repaint();
  }
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

@Override
public Component getCustomEditor() {
  JComponent pane = makePanel();
  pane.doLayout();
  pane.validate();
  return pane;
}

代码示例来源:origin: nl.cloudfarming.client/cloudfarming-client-geoviewer-jxmap

public static BufferedImage createImage(JComponent component, int imageType) {
  Dimension componentSize = component.getPreferredSize();
  component.setDoubleBuffered(false);
  component.setSize(componentSize);
  component.validate();
  BufferedImage img = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(component.getSize().width,
      component.getSize().height, imageType);
  Graphics2D grap = img.createGraphics();
  component.print(grap);
  grap.dispose();
  return img;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

private JComponent layoutComponent(JComponent component) {
  // Initial component sizing & layout
  if (getClientSize().width > 0) {
    component.setSize(getClientSize()); // try to fit the component to ComponentMorpher
    component.validate(); // layout component
    // Correct component sizing & layout
    component.setSize(new Dimension(getClientSize().width, component.getPreferredSize().height)); // Width of component is fixed, update height
    component.validate(); // layout component
  }
  return component;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-mobility-svgcore

public SVGImagePanel(JComponent imagePanel) {
  this.imagePanel = imagePanel;
  setLayout( new CenteredLayoutManager());
  add(imagePanel);
  setDoubleBuffered(true);
  canPaint = new AtomicBoolean( true );
  myErrorComponent = new JLabel( NbBundle.getMessage(SVGImagePanel.class, 
      "ERR_UnableRender")); 
  myErrorComponent.validate();
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void setBoundsForFrame(JComponent _f,int _x,int _y,int _w,int _h)
{
 boolean resized=(getWidth(_f)!=_w)||(getHeight(_f)!=_h);
 _f.setBounds(_x,_y,_w,_h);
 if(resized) _f.validate();
 //super.setBoundsForFrame(_f,_x,_y,_w,_h);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void setMainPanel(BuMainPanel _p) {
 if (main_panel_ != null && hasDesktop()) main_panel_.removeContainerListener(this);
 main_panel_ = _p;
 content_.add(main_panel_, BuBorderLayout.CENTER);
 content_.doLayout();
 content_.validate();
 if (hasDesktop()) main_panel_.getDesktop().addContainerListener(this);
}

相关文章

JComponent类方法