Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Taller 4

  • Be the first to comment

  • Be the first to like this

Taller 4

  1. 1. importjava.awt.*;importjavax.swing.*;public class w extends JFrame{publicVentanaBorderLayout() {super("Agregatitulo");Container COn=getContentPane();JButton b1=new JButton("A");JButton b2=new JButton("B");JButton b3=new JButton("C");JButton b4=new JButton("D");JButton b5=new JButton("E");COn.setLayout(new BorderLayout());COn.add(b1,BorderLayout.NORTH);//arribaCOn.add(b2,BorderLayout.SOUTH);//abajoCOn.add(b3,BorderLayout.WEST);//izquierdaCOn.add(b4,BorderLayout.EAST);//derechoCOn.add(b5,BorderLayout.CENTER);//centrosetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}public static void main (String[] args) {VentanaBorderLayout v=new VentanaBorderLayout();v.setSize(300,300);v.setVisible(true);}
  2. 2. }importjava.awt.*;importjavax.swing.*;public class VentanaFlowLayout extends JFrame{publicVentanaFlowLayout() {super("Agregatitulo");Container COn=getContentPane();JButton b1=new JButton("A");JButton b2=new JButton("B");JButton b3=new JButton("BOTON MAS LARGO");JButton b4=new JButton("D");JButton b5=new JButton("E");COn.setLayout(new FlowLayout());COn.add(b1);COn.add(b2);COn.add(b3);COn.add(b4);COn.add(b5);}public static void main (String[] args) {VentanaFlowLayout vent=new VentanaFlowLayout();vent.setSize(200,200);vent.setVisible(true);vent.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  3. 3. }}public class VentanaGridLayout extends JFrame{public VentanaGridLayout() {super("4.3. GridLayout");Container Leo=getContentPane();JButton b1=new JButton("BOTON 1");JButton b2=new JButton("BOTON 2");JButton b3=new JButton("BOTON 3");JButton b4=new JButton("BOTON 4");JButton b5=new JButton("BOTON 5");Leo.setLayout(new GridLayout(3,3));Leo.add(b1);Leo.add(b2);Leo.add(b3);Leo.add(b4);Leo.add(b5);setSize(300,300);setVisible(true);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}public static void main (String[] args) {newVentanaGridLayout();}}

    Be the first to comment

    Login to see the comments

Views

Total views

286

On Slideshare

0

From embeds

0

Number of embeds

56

Actions

Downloads

0

Shares

0

Comments

0

Likes

0

×