private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { final Point p=this.getLocation(); //final Dimension d=this.getSize(); //final Dimension d2=Toolkit.getDefaultToolkit().getScreenSize(); final Component c=null; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { ShowRates xyz = new ShowRates(arvot); int x=(int) p.getX(); int y=(int) p.getY(); // c.getComponentAt(p); xyz.setLocationRelativeTo(c); //xyz.setLocation(x+(int)d.getWidth(),y); xyz.setVisible(true); } });