/** * Constructor for separate display and data images. * * @param displayImg image to be displayed * * @param dataImg an image with bounds equal to, or enclosing, those of * displayImg and which contains data that will be reported in the status * bar; if null data will be drawn from the display image * * @param title title for the frame */ public ImageFrame(RenderedImage displayImg, RenderedImage dataImg, String title) { setTitle(title); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocationByPlatform(true); ImagePane pane = new ImagePane(this, displayImg, dataImg); getContentPane().add(pane, BorderLayout.CENTER); sb = new StringBuilder(); statusBar = new JTextField(); statusBar.setEditable(false); statusBar.setMinimumSize(new Dimension(100, 30)); statusBar.setBorder(BorderFactory.createLoweredBevelBorder()); getContentPane().add(statusBar, BorderLayout.SOUTH); pack(); setSize(500, 500); }
/** * Constructor for separate display and data images. * * @param displayImg image to be displayed * * @param dataImg an image with bounds equal to, or enclosing, those of * displayImg and which contains data that will be reported in the status * bar; if null data will be drawn from the display image * * @param title title for the frame */ public ImageFrame(RenderedImage displayImg, RenderedImage dataImg, String title) { setTitle(title); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocationByPlatform(true); ImagePane pane = new ImagePane(this, displayImg, dataImg); getContentPane().add(pane, BorderLayout.CENTER); sb = new StringBuilder(); statusBar = new JTextField(); statusBar.setEditable(false); statusBar.setMinimumSize(new Dimension(100, 30)); statusBar.setBorder(BorderFactory.createLoweredBevelBorder()); getContentPane().add(statusBar, BorderLayout.SOUTH); pack(); setSize(500, 500); }