[Gvsig_desarrolladores] Panel Información de un Layer
"Jose Manuel Vivó Arnal ( Chema )
"Jose Manuel Vivó Arnal ( Chema )
Jue Dic 1 14:03:19 CET 2011
La "mejor" (flexible y estándar) solución es establecer un "layout" al
panel (por ejemplo el GridBagLayout [2][3]). Aquí[1] tienes una guía de
como funcionan los estándar de java.
[1] http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html
[2] http://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html
[3] http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/GridBagLayout.html
Un saludo.
Chema.
El 01/12/11 12:12, Ruth Sos Del Diego escribió:
> Hola a todos,
>
> De nuevo necesito una ayuda. A partir de una extensión que hay en la web
> "Extworkshop" he modificado el código para obtener un panel de
> información personalizado de un layer de mi proyecto. El código sería:
>
> private void initialize() {
> jLabel = new JLabel();
> jLabel.setText("State:");
> this.setSize(new Dimension(286, 132));
> this.setPreferredSize(new Dimension(286, 132));
> this.add(jLabel, null);
> this.add(getTxtProvin(), null);
>
> jLabel2 = new JLabel();
> jLabel2.setText("Region:");
> this.setSize(new Dimension(286, 132));
> this.setPreferredSize(new Dimension(286, 132));
> this.add(jLabel2,null);
> this.add(getTxtProvin2(), null);
>
> .
> .
>
> public WindowInfo getWindowInfo() {
> if (wi==null)
> {
> wi = new WindowInfo( WindowInfo.PALETTE );
> wi.setHeight(400);
> wi.setWidth(400);
>
> wi.setTitle("Information sugarcane in the States");
>
> }
> return wi;
> }
> .
> .
> .
>
> private JTextField getTxtProvin() {
> if (txtProvin == null) {
> txtProvin = new JTextField();
> txtProvin.setPreferredSize(new Dimension(100, 20));
> }
> return txtProvin;
>
> }
>
> private JTextField getTxtProvin2() {
> if (txtProvin2 == null) {
> txtProvin2 = new JTextField();
> txtProvin2.setPreferredSize(new Dimension(100, 20));
>
> }
> return txtProvin2;
>
> }
>
> Necesito que se muestre una línea debajo de otra. Adjunto un screenshot
> del resultado. Cómo puedo indicarle que JLabel y JText se escriban uno
> debajo del otro?
>
> Gracias de antemano,
>
> Ruth
>
>
>
>
>
>
>
>
> _______________________________________________
> gvSIG_desarrolladores mailing list
> gvSIG_desarrolladores en listserv.gva.es
> Para ver histórico de mensajes, editar sus preferencias de usuario o darse de baja en esta lista, acuda a la siguiente dirección: http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores
--
Jose Manuel Vivó Arnal
DiSiD Technologies S.L. (http://www.disid.com)
Más información sobre la lista de distribución gvSIG_desarrolladores