Cita de: PHByte en 22 Enero 2016, 13:26 PM
Muchisimas gracias! Tendre en cuenta las citaciones para proximas veces
Él se refiere a esta etiqueta:
Saludos.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: PHByte en 22 Enero 2016, 13:26 PM
Muchisimas gracias! Tendre en cuenta las citaciones para proximas veces
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
public class FlightReservation extends JFrame
{
public FlightReservation() {
super("Flight Reservation Dialog");
setSize(400, 300);
JPanel p1 = new JPanel();
p1.setLayout(new BoxLayout(p1, BoxLayout.X_AXIS));
JPanel p1r = new JPanel();
p1r.setBorder(new EmptyBorder(10, 10, 10, 10));
// Variant 1
p1r.setLayout(new GridLayout(3, 2, 5, 5));
p1r.add(new JLabel("Date:"));
p1r.add(new JTextField());
p1r.add(new JLabel("From:"));
JComboBox cb1 = new JComboBox();
cb1.addItem("New York");
p1r.add(cb1);
p1r.add(new JLabel("To:"));
JComboBox cb2 = new JComboBox();
cb2.addItem("London");
p1r.add(cb2);
p1.add(p1r);
JPanel p3 = new JPanel();
p3.setLayout(new BoxLayout(p3, BoxLayout.Y_AXIS));
String[] list = {"UNO","DOS","TRES","CUATRO","CINCO","SEIS","SIETEASDAS"};
ScrollPane scrollpane = new ScrollPane();
scrollpane.add(new JList(list));
p3.add(scrollpane);
p1.add(p3);
getContentPane().add(p1, BorderLayout.NORTH);
JPanel p4 = new JPanel();
JPanel p4c = new JPanel();
p4c.setLayout(new GridLayout(1, 3, 5, 5));
JButton b1 = new JButton("Search");
p4c.add(b1);
JButton b2 = new JButton("Purchase");
p4c.add(b2);
JButton b3 = new JButton("Exit");
p4c.add(b3);
p4.add(p4c);
getContentPane().add(p4, BorderLayout.CENTER);
WindowListener wndCloser = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
};
addWindowListener(wndCloser);
setVisible(true);
}
public static void main(String argv[]) {
new FlightReservation();
}
}
CitarA ver si sacáis porque sucede esto
[i][j] ->[2][3]->[0x0009][3] ->[0x0009 + 3] -> (La dirección de memoria donde está el 8)
Cita de: DeviiAC en 19 Enero 2016, 23:34 PM
bueno seria mejor si no se utilizara funciones geométricas es decir sin senos ni cosenos-
Cita de: DeviiAC en 19 Enero 2016, 23:34 PM
gracias chaval pero no es lo que buscaba, si tienes alguna idea me decis please
int[] arreglo;
int[] arreglo;
arreglo = new int[] {3,4,1};
arreglo = new int[] {3,4,1,4,2,3};
arreglo = new int[] {3,4,1,4,2,3,4,2,4,2};
// declares an array of integers
int[] anArray;
// allocates memory for 10 integers
anArray = new int[10];
// initialize first element
anArray[0] = 100;
// initialize second element
anArray[1] = 200;
// and so forth
anArray[2] = 300;
anArray[3] = 400;
anArray[4] = 500;
anArray[5] = 600;
anArray[6] = 700;
anArray[7] = 800;
anArray[8] = 900;
anArray[9] = 1000;