t1.setBounds();
Código:
import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.URL; public class SIT { Personas persona=new Personas(); JFrame sit=new JFrame("SITT"); String path1="/header.png", path2="/personal.png", path3="/personalhover.png", path4="/alumno.png", path5="/alumnoshover.png", path6="/aspirante.png", path7="/aspirantehover.png"; URL url1=this.getClass().getResource(path1), url2=this.getClass().getResource(path2), url3=this.getClass().getResource(path3), url4=this.getClass().getResource(path4), url5=this.getClass().getResource(path5), url6=this.getClass().getResource(path6), url7=this.getClass().getResource(path7); ImageIcon header=new ImageIcon(url1),personal=new ImageIcon(url2), personalhover=new ImageIcon(url3), alumno=new ImageIcon(url4), alumnoshover=new ImageIcon(url5), aspirante=new ImageIcon(url6), aspirantehover=new ImageIcon(url7); JTextField t1; JPasswordField nipin; JPanel ventananip; String camino="/login.png", camino2="/acceso.png"; URL Purl=this.getClass().getResource(camino), Purl2=this.getClass().getResource(camino2); ImageIcon login=new ImageIcon(Purl), acceso=new ImageIcon(Purl2); SIT(){ sit.setLayout(null); JLabel l1=new JLabel(""); l1.setBounds(0,0,869,100); l1.setIcon(header); sit.add(l1); ventananip=new JPanel(); ventananip.setLayout(null); JLabel log=new JLabel(""); log.setIcon(login); log.setBounds(0,0,364,130); ventananip.add(log); t1.setBounds(50,50,100,30); ventananip.add(t1); nipin.setBounds(50, 80, 100, 30); ventananip.add(nipin); JButton b1=new JButton(acceso); b1.setBounds(140,120,58,21); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ } }); ventananip.add(b1); ventananip.setBounds(200,300,364,130); JButton butpersonal=new JButton(personal); butpersonal.setBounds(30,150,325,37); butpersonal.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ sit.getContentPane().add(ventananip); ventananip.setVisible(true); } }); sit.add(butpersonal); JButton butalumno=new JButton(alumno); butalumno.setBounds(320,200,167,36); butalumno.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ sit.getContentPane().add(ventananip); ventananip.setVisible(true); } }); sit.add(butalumno); JButton butaspirante=new JButton(aspirante); butaspirante.setBounds(500,240,200,38); butaspirante.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ sit.getContentPane().add(ventananip); ventananip.setVisible(true); } }); sit.add(butaspirante); sit.setSize(869,550); sit.setVisible(true); } public static void main(String args[]){ SIT main=new SIT(); } }