java.awt.Panel.getComponent()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(189)

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

Panel.getComponent介绍

暂无

代码示例

代码示例来源:origin: net.preibisch/multiview-reconstruction

  1. @Override
  2. public void textValueChanged(TextEvent e)
  3. {
  4. String path = ((TextField)pan.getComponent( 0 )).getText();
  5. System.out.println(path);
  6. if (path.endsWith( File.separator ))
  7. path = path.substring( 0, path.length() - File.separator.length() );
  8. if(new File(path).isDirectory())
  9. path = String.join( File.separator, path, "*" );
  10. lab.setText( previewFiles( getFilesFromPattern(path , Long.parseLong( num.getText() ) * KB_FACTOR)));
  11. lab.setSize( lab.getPreferredSize() );
  12. gdp.setSize( gdp.getPreferredSize() );
  13. gdp.validate();
  14. }
  15. } );

代码示例来源:origin: net.preibisch/multiview-reconstruction

  1. @Override
  2. public void textValueChanged(TextEvent e)
  3. {
  4. String path = ((TextField)pan.getComponent( 0 )).getText();
  5. if (path.endsWith( File.separator ))
  6. path = path.substring( 0, path.length() - File.separator.length() );
  7. if(new File(path).isDirectory())
  8. path = String.join( File.separator, path, "*" );
  9. lab.setText( previewFiles( getFilesFromPattern(path , Long.parseLong( num.getText() ) * KB_FACTOR)));
  10. lab.setSize( lab.getPreferredSize() );
  11. gdp.setSize( gdp.getPreferredSize() );
  12. gdp.validate();
  13. }
  14. } );

代码示例来源:origin: net.preibisch/multiview-reconstruction

  1. ((TextField)pan.getComponent( 0 )).addTextListener( new TextListener()

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

  1. private void progress() {
  2. if (display()) {
  3. final ImageJ ij = IJ.getInstance();
  4. if (ij != null) { // To avoid exceptions in batch mode
  5. String s = status();
  6. final double min = min();
  7. final double max = max();
  8. final double p = min + percent*(max - min);
  9. if (s == null || p >= 1) s = "";
  10. IJ.showStatus(s);
  11. IJ.showProgress(p);
  12. if (enforce()) {
  13. final Panel sb = ij.getStatusBar();
  14. final JLabel sl = (JLabel)sb.getComponent(0);
  15. sl.setOpaque(true); // Transparent by default
  16. sl.paintImmediately(sl.getBounds());
  17. final ProgressBar pb = (ProgressBar)sb.getComponent(1);
  18. final Graphics pg = pb.getGraphics();
  19. if (pg != null) pb.paint(pg);
  20. }
  21. }
  22. }
  23. }

代码示例来源:origin: mpicbg/mpicbg_

  1. GUI( final ImagePlus imp )
  2. {
  3. window = imp.getWindow();
  4. canvas = imp.getCanvas();
  5. scrollBar = ( Scrollbar )( ( Panel )window.getComponent( 1 ) ).getComponent( 1 );
  6. scrollBarValue = scrollBar.getValue();
  7. scrollBarVisible = scrollBar.getVisibleAmount();
  8. scrollBarMin = scrollBar.getMinimum();
  9. scrollBarMax = scrollBar.getMaximum();
  10. ij = IJ.getInstance();
  11. }

代码示例来源:origin: axtimwalde/mpicbg

  1. GUI( final ImagePlus imp )
  2. {
  3. window = imp.getWindow();
  4. canvas = imp.getCanvas();
  5. scrollBar = ( Scrollbar )( ( Panel )window.getComponent( 1 ) ).getComponent( 1 );
  6. scrollBarValue = scrollBar.getValue();
  7. scrollBarVisible = scrollBar.getVisibleAmount();
  8. scrollBarMin = scrollBar.getMinimum();
  9. scrollBarMax = scrollBar.getMaximum();
  10. ij = IJ.getInstance();
  11. }

代码示例来源:origin: ca.mcgill/Sholl_Analysis

  1. try { // Access "units" label
  2. final Panel p = (Panel) gd.getComponent(gd.getComponentCount() - 1);
  3. final Label l = (Label) p.getComponent(1);
  4. l.setForeground(EnhancedGenericDialog.getDisabledComponentColor());
  5. } catch (final Exception ignored) {

相关文章