JComboBox with two columns

Hello

I found a nice piece of code in the forum, which extends a JComboBox to display
two columns.
Now I am trying to add my own demands, namely the combo should be editable
and only the first column should appear in the edit field and become the
selected value.

I thought to write an own editor that "catches" the posting process for
manipulate the text that will be displayed. Because the rendering engine uses a
JPanel to display columns, I expect this Panel must be passed in the
setItem method (...) the editor. But it isn't, and I can't even detect
what object is passed.

I wonder if this approach is advisable at all. If comments or ideas
are welcome.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 
public class Main extends JFrame {        
    public static final long serialVersionUID= 70L;

    public Main() {        
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final JComboBox<Object> priceList = new JComboBox<>(new Object[] {
            new Object[] { "Lemon", 0.5 },
            new Object[] { "Cherry", 3 },
            new Object[] { "Apple", 1 },
        });
        priceList.setEditable(true);
     priceList.setEditor(new MyEditor());
        priceList.setRenderer(new MyRenderer());
        add(priceList, BorderLayout.CENTER);

     JButton b= new JButton("OK");
     b.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
         System.out.println(priceList.getSelectedItem());
       }
     });
        add(b, BorderLayout.SOUTH);
        pack();
    }
    
    public static void main(String... args) 
    throws Exception {                
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new Main().setVisible(true);
            }
        });
    }



  class MyEditor extends JTextField implements ComboBoxEditor {
    public static final long serialVersionUID= 71L;

    public Component getEditorComponent() {
      return this;
    }

    public Object getItem() {
      return getText();
    }

    public void setItem(Object obj) {
      System.out.println("Setting item");
      System.out.println(obj);
      if (obj instanceof JPanel) System.out.println("Panel");
      if (obj instanceof JLabel) System.out.println("Label");
      if (obj instanceof String) System.out.println("String");
      setText("Hello");
    }
  }

 
/** 
 * This class uses panel with two labels to render the list (combobox) cell.
 */
  class MyRenderer extends JPanel implements ListCellRenderer<Object> {
    public static final long serialVersionUID= 72L;
    JLabel labels[] = { new JLabel(), new JLabel() };

    public MyRenderer() {
        setLayout(new GridBagLayout());
        // Add labels
        GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.1;
        add(labels[0],c);
        add(labels[1]);
    }

    public Component getListCellRendererComponent(JList<?> list, Object value,
               int index, boolean isSelected, boolean cellHasFocus) {
        Object rowData[] = (Object[])value;
        // Prepare colors
        Color foreground = isSelected? 
            list.getSelectionForeground(): list.getForeground();
        Color background = isSelected?
            list.getSelectionBackground(): list.getBackground();
        // Set panel colors
        setForeground(foreground);
        setBackground(background);
        int col = 0;
        for(JLabel label : labels) {
            label.setBackground(background);
            label.setForeground(foreground);
            label.setText( String.valueOf(rowData[col++]) );
        }
        return this;
    }
  }

}

As an alternative, I thought that usiing a JComboBox 'ordinary' with the strings in column 1 as elements and you try to change the popup so that it displays and column 2.

You can render the comboBox and the popup differently. Just check for an index of-1 for the drop-down list box.

Different examples of how you can restore more than one column in a combo box. The example of "text pane" has been changed so that the drop-down list box shows only one column while the popup shows the two columns:

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.text.*;

public class ComboBoxMultiColumn extends JFrame
{
     public ComboBoxMultiColumn()
     {
          getContentPane().setLayout( new GridLayout(0, 2) );

          Vector items = new Vector();
          items.addElement( new Item("123456789", "Car" ) );
          items.addElement( new Item("23", "Plane" ) );
          items.addElement( new Item("345", "Train" ) );
          items.addElement( new Item("4567", "Nuclear Submarine" ) );

          //  Use a JTextArea as a renderer

          JComboBox comboBox1 = new JComboBox( items );
          comboBox1.setRenderer( new TextAreaRenderer(5) );

          getContentPane().add( new JLabel("TextArea Renderer") );
          getContentPane().add( comboBox1 );

          //  Use a JTextPane as a renderer

          JComboBox comboBox2 = new JComboBox( items );
          comboBox2.setRenderer( new TextPaneRenderer(10) );

          getContentPane().add( new JLabel("TextPane Renderer") );
          getContentPane().add( comboBox2 );

          //  Use a JPanel as a renderer

          JComboBox comboBox3 = new JComboBox( items );
          comboBox3.setRenderer( new PanelRenderer(50) );

          getContentPane().add( new JLabel("Panel Renderer") );
          getContentPane().add( comboBox3 );

          //  Using HTML

          JComboBox comboBox4 = new JComboBox( items );
          comboBox4.setRenderer( new HTMLRenderer() );

          getContentPane().add( new JLabel("HTML Renderer") );
          getContentPane().add( comboBox4 );
     }

     class Item
     {
          private String id;
          private String description;

          public Item(String id, String description)
          {
               this.id = id;
               this.description = description;
          }

          public String getId()
          {
               return id;
          }

          public String getDescription()
          {
               return description;
          }

          public String toString()
          {
               return description;
          }
     }

     public static void main(String[] args)
     {
          JFrame frame = new ComboBoxMultiColumn();
          frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
          frame.pack();
          frame.setVisible( true );
     }

     /*
     **  Tabs are easier to use in a JTextArea, but not very flexible
     */
     class TextAreaRenderer extends JTextArea implements ListCellRenderer
     {
          public TextAreaRenderer(int tabSize)
          {
               setTabSize(tabSize);
          }

          public Component getListCellRendererComponent(JList list, Object value,
               int index, boolean isSelected, boolean cellHasFocus)
          {
               Item item = (Item)value;
               setText(item.getId() + "\t" + item.getDescription());
               setBackground(isSelected ? list.getSelectionBackground() : null);
               setForeground(isSelected ? list.getSelectionForeground() : null);
               return this;
          }
     }

     /*
     **  Tabs are harder to use in a JTextPane, but much more flexible
     */
     class TextPaneRenderer extends JTextPane implements ListCellRenderer
     {
          public TextPaneRenderer(int tabColumn)
          {
               setMargin( new Insets(0, 0, 0, 0) );

               FontMetrics fm = getFontMetrics( getFont() );
               int width = fm.charWidth( 'w' ) * tabColumn;

               TabStop[] tabs = new TabStop[1];
               tabs[0] = new TabStop( width, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE );
               TabSet tabSet = new TabSet(tabs);

               SimpleAttributeSet attributes = new SimpleAttributeSet();
               StyleConstants.setTabSet(attributes, tabSet);
               getStyledDocument().setParagraphAttributes(0, 0, attributes, false);
          }

          public Component getListCellRendererComponent(JList list, Object value,
               int index, boolean isSelected, boolean cellHasFocus)
          {
               Item item = (Item)value;

               if (index == -1)
                    setText( item.getDescription() );
               else
                    setText(item.getId() + "\t" + item.getDescription());

               setBackground(isSelected ? list.getSelectionBackground() : null);
               setForeground(isSelected ? list.getSelectionForeground() : null);
               return this;
          }
     }

     /*
     **  Use a panel to hold multiple components
     */
     class PanelRenderer implements ListCellRenderer
     {
          private JPanel renderer;
          private JLabel first;
          private JLabel second;

          public PanelRenderer(int firstColumnWidth)
          {
               renderer = new JPanel();
               renderer.setLayout(new BoxLayout(renderer, BoxLayout.X_AXIS) );

               first = new JLabel(" ");
               Dimension d = first.getPreferredSize();
               d.width = firstColumnWidth;
               first.setMaximumSize(d);
               second = new JLabel();
               renderer.add(first );
               renderer.add(second );
          }

          public Component getListCellRendererComponent(JList list, Object value,
               int index, boolean isSelected, boolean cellHasFocus)
          {
               Item item = (Item)value;

               first.setText( item.getId() );
               second.setText( item.getDescription() );

               renderer.setBackground(isSelected ? list.getSelectionBackground() : null);
               renderer.setForeground(isSelected ? list.getSelectionForeground() : null);

               return renderer;
          }
     }

     /*
     **  Use HTML to format the text
     */
     class HTMLRenderer extends DefaultListCellRenderer
     {
          private static final String START = "
"; private static final String MIDDLE = ""; private static final String END = "
"; public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); Item item = (Item)value; setText(START + item.getId() + MIDDLE + item.getDescription() + END); return this; } } }

Tags: Java

Similar Questions

  • I want to put two tables on a page with two columns how can I do this?

    I want to put two tables on a page with two columns how can I do this?

    It depends on what application you are using.

    If you use Word, then a good way would be to create a single table of 5 columns, check the borders of the invisible middle column so that it appears to be two separate tables.  You will need to do the same thing for unused cells downstairs as well.

    To get the best advice on Office-Word questions, use the forum not the Windows 7 Office forum that you do.  Look at the top of this page, just below the logo MS Answers and click on Forums , then select desktop. Once there, you can select Word.  By using the forum Office will give you a better chance to find a solution to your problem, as it is inhabited by people who know much about their topic.  Search the Forum of office for the topic, then, if no notice is found, ask your question here instead of this.

  • Fill a table with two columns using a custom bean

    Hello

    Can you provide me or give me a link to an example of populating a table (with two columns) with a custom bean?

    Thank you

    TSPS

    Hello..
    I'm Jules Destrooper is what you want

    http://download.Oracle.com/docs/CD/E18941_01/tutorials/jdtut_11r2_36/jdtut_11r2_36.html

    Hopes, will help you

  • How to make a panelformLayout with two columns, where I need a column wider than the other?

    The second column must be more or less double first thant.

    It's the definition of the form:

    < af:panelFormLayout id = "pfl1" lines = '6' labelWidth = "120".

    Binding = "#{backingBeanScope.detalleBB.pfl1}" >

    two columns of fields is displayed.

    The second column has several panelgrouplayout - horizontal with three different areas requiring a more horizontal space than the first column which are fields of inoputtext.

    Currently the panelform gives the same horizontal space resulting in the packing in the second two-column and this conditioning is what I want to avoid.

    Thank you in advance.

    You plan to create another PanelFormLayout with a different width and put the two forms of panel inside a horizontal panel group presentation so that they compare side by side?

  • Input data match with two columns in a table

    Hello

    I want to find records where the input data (> 100 records) are adapted to the two columns of the table

    See below
    with t as
    (select 1 as id, 101 as num 'ram' that pat from dual
    Union
    Select 2 102, 'tom' from dual
    Union
    Select 1 103, 'tom1' from dual
    Union
    Select 2 101, 'tom2' from dual
    Union
    Select 2 104, 'tom3' from dual
    Union
    Select 1 105, 'tom1' from dual
    Union
    Select 2 105, 'tom1' from dual

    )
    Select * from t

    I want to find records from the 't' table where (id, num) will be (1 101, 2 102, 1, 105)

    Output must be

    ID num
    1 101
    2 102
    1 105
    select *
    from t
    where  (id, num) in (
              (1,101),
              (2,102),
              (1,105)
                 );
    

    Or store the input in a temporary table values and use IN

    select *
    from t
    where  (id, num) in (
              select col1,col2
                                    from your_temp_table
                 );
    

    Published by: JAC on 20 may 2013 14:55

  • Should be changed to two full pages in a single page with two columns

    I have a schedule that is formatted to 8 1/2 x 11 size.  I want to change this option to display two pages on one page into two columns?  How can I do this?  Thanks in advance.

    It's extremely well beyond what is possible or even imaginable for PDF editing. Redo in Word; You can use export as Word, copy paste and export the images as tools to do this. Then again the PDF file.

  • selection of lines corresponding to two columns with two entry tables

    I have a table with two columns int primary key tab1. id1 and id2.

    Now I have two created two tables of figures: array1 {1, 2, 3,...} and {0, 1, 0,...} array2 Arrays have the same length.

    I want to do a select:
    Select * from tab1 where tab1.id1 = array1.column_value and tab1.id2 = array2.column_value;

    If I want to receive 13 lines with this request, I had 169 because it tries to match all the different combinations in the tables.

    If I do it with a loop for:

    for i of array1
    loop
    Select * from tab1 where tab1.id1 = array1 (i) and tab1.id2 (i);
    end

    That should illustrate what I want to do, I just thought it would be faster if I could do it without a loop, do not use the pl/sql. Can it be done? If not, should I use a loop for with bulk collect somehow?
    SQL> with t as (
      select 1 id1, 0 id2 from dual union all
      select 2, 0 from dual union all
      select 3, 0 from dual union all
      select 4, 1 from dual
    )
    --
    --
    select id1, id2
    from t,
         (select rownum rn1, a1.* from table (sys.odcinumberlist (1, 2, 3, 4)) a1) a1, --- array1
         (select rownum rn2, a2.* from table (sys.odcinumberlist (0, 1, 0, 1)) a2) a2  --- array2
    where (id1, id2) in ( (a1.column_value, a2.column_value)) and rn1 = rn2
    /
           ID1        ID2
    ---------- ----------
             1          0
             3          0
             4          1
    
    3 rows selected.
    
  • Field in the list with 2 columns

    I am creating listfield with two columns as follows [2 |]  Cokes].

    There is an example on how to do this?

    There is an article on the basis of knowledge to developers to add checkbox to a field, but I don't see anything on the creation of several columns.

    Maybe I can get away with adding a field of text instead of a checkbox or have two fields next to the list and sync.

    any suggestions?

    ListField on nature has a great column.

    You can override drawListRow() to ListFieldCallback to divide each row number of columns.

    In this case, you will need to control the width of each column using the class font getAdvance() method that returns the width of the displayed string. And if you combine graphics and text in columns, you will need to also use getWidth() instance method of the Bitmap class to calculate the width of each column.

  • Insertion of a middle Page of separate text on a two column layout box

    Hello!

    I'm working on a book with a layout in two columns.  At various times, I need to insert what are effectively the chapter breaks.  Currently I have a giant text block flowing for all 65 pages.  This provision is (I think?) made necessary by the scripts that I am running for our line numbers and our notes.

    My original idea was to put the chapter title in a separate text block and wrap the text around it, so that I can keep the unique setting of the main text.  Unfortunately, in the two-column layout, this means that the text in the first column went * under * the title of the chapter to complete the first column, no matter where I moved it.

    I think I may need to end the block of text of the first chapter and start a second for the new chapter get the result I want.  However, I have a few worries about that: first of all, if I ended up simply text block, I should remove the other 55 pages (after the break) I already partially formatted and screw them from scratch in the text box of the new chapter?  Secondly, I also fear that making a separate text block could ruin my scripts endnote and line numbers.

    (NB: if I need to put an end to this block of text and starting a new one, I can't find a way to do it on a page at the beginning of a block of text in several pages, so I need help with this, too.)

    Y at - it a simple way to insert this text box so that text of the first chapter ends perfectly in two columns above it, and the next chapter starts cleanly into two columns underneath?

    Please see attached screen captures, showing the current state of things.  The text box has been inserted with a simple wrap around it.

    2016-08-02 (1).png

    THANK YOU IN ADVANCE!

    Hello

    Have you checked characteristic Columns Span integrated InDesign? http://InDesignSecrets.com/timesaver-span-and-split-columns-in-CS5.php

    Now that you have your text formatted in a single framework with two columns, you can select the chapter header text and tell him to cover all the columns in the text block.

    This warp the need to set up a separate text frame.

    The only downside I can think is that you use the the duration columns can slow down InDesign a bit.

    Ariel

  • Update a table with one column of another

    Oracle 11g
    Hello

    i'im trying to update the two columns of table SUPPORT (SUPPORT_X, SUPPORT_Y) with two columns of table POST_HTA_BT (POSTHTABT_GPS_X, POSTHTABT_GPS_Y)

    Understand that the two tables have the colum below:

    SUPPORT (SUPPORT_ID, SUPPORT_PLAQUE, POSTHTABT_ID, SUPPORT_X, SUPPORT_Y,...)

    POST_HTA_BT (POSTHTABT_ID, POSTHTABT_GPS_X, POSTHTABT_GPS_Y,...)

    The SUPPORT_PLAQUE has type varachar. Except the keys, the other columns are varchar type in both tables.

    The point here is to update the support_x, support_y with posthtabt_gps_x and posthtabt_gps_y.But before the update we have Sheik if the fifth number of the support plate is a number of characters from "0" to "9"and the rest of the caracter of the support_plaque is '00000'

    Please note that the support_plaque is stored in the table with the form: "0025800000!"

    So I did the below script, I try to execute in sql develop.

    SET SERVEROUTPUT ON

    DECLARE
    chiffre_liste varchar (200): = '0 ', '1', '2', '3', '4', ' 5 ', ' 6' ', 7', ' 8 ', ' 9';
    CURSOR CUR_GPS_SUPPORT IS
    Select MEDIA. SUPPORT_X, SUPPORT. SUPPORT_Y, POSTE_HTA_BT. POSTHTABT_ID, SUPPORT. EXPL_ID,
    SUPPORTED. SUPPORT_PLAQUE, POSTHTABT_GPS_X, POSTHTABT_GPS_Y
    support,.
    POSTE_HTA_BT
    where
    SUPPORTED. SUPPORT_X IS NULL and
    SUPPORTED. SUPPORT_Y IS NULL and
    SUPPORTED. POSTHTABT_ID = POSTE_HTA_BT. POSTHTABT_ID and
    SUPPORTED. EXPL_ID = POSTE_HTA_BT. EXPL_ID
    Order of SUPPORT. POSTHTABT_ID;

    w_POSTHTABT_ID POSTE_HTA_BT. Type of POSTHTABT_ID %;
    w_SUPPORT_X SUPPORT. TYPE % SUPPORT_X;
    w_SUPPORT_Y SUPPORT. TYPE % SUPPORT_Y;
    w_EXPL_ID SUPPORT. TYPE % EXPL_ID;
    w_SUPPORT_PLAQUE SUPPORT. TYPE % SUPPORT_PLAQUE;
    w_POSTHTABT_GPS_X POSTE_HTA_BT. TYPE % POSTHTABT_GPS_X;
    w_POSTHTABT_GPS_Y POSTE_HTA_BT. TYPE % POSTHTABT_GPS_Y;

    BEGIN
    DBMS_OUTPUT. Put_line ('loading the coordoonnees GPS - GPS Coord update takes care of starting ');

    FOR HEART LOOPING CUR_GPS_SUPPORT

    w_POSTHTABT_ID: = cur. POSTHTABT_ID;
    w_SUPPORT_PLAQUE: = cur. SUPPORT_PLAQUE;
    w_SUPPORT_X: = cur. SUPPORT_X;
    w_SUPPORT_Y: = cur. SUPPORT_Y;
    w_POSTHTABT_GPS_X: = cur. POSTHTABT_GPS_X;
    w_POSTHTABT_GPS_Y: = cur. POSTHTABT_GPS_X;

    If substr (cur.support_plaque, 5, 1 chiffre_liste) and substr (cur.support_plaque, 6, 5) = '00000'
    w_SUPPORT_X: = CUR. POSTHTABT_GPS_X
    w_SUPPORT_Y: = CUR. POSTHTABT_GPS_Y
    END if;
    EXCEPTION WHEN NO_DATA_FOUND THEN w_SUPPORT_X: = NULL and w_SUPPORT_Y: = NULL;
    END;

    -Updated the table of the supports
    Update SUPPORT
    Set SUPPORT_X = w_SUPPORT_X,
    SUPPORT_Y = w_SUPPORT_Y
    where SUPPORT_PLAQUE = w_SUPPORT_PLAQUE;
    -On valid imm? immediately
    commit;
    EXCEPTION when no_data_found then null;
    -No details found
    END;

    END;
    /

    and I got the following errors:

    Error report:
    ORA-06550: line 2, colum 34:
    PLS-00103: symbol ',' met instead of one of the following symbols:

    * & = - + ; <>/ is mod remains not rem
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | submultiset of type multiset Member
    ORA-06550: line 2, column 52:
    PLS-00103: symbol ';' met instead of one of the following symbols:

    ), * & = - + <>/ is mod remains not rem = >
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | Member of multiset must
    ORA-06550: line 38, colum 48:
    PLS-00103: symbol 'CHIFFRE_LISTE' met instead of one of the following symbols:

    (
    Symbol "(" a été substitué à "CHIFFRE_LISTE" verser continuer.) "
    ORA-06550: line 39, 12 colum:
    PLS-00103: symbol 'W_SUPPORT_X' met instead of one of the following symbols:

    ), * & -+ / at rem mod < Hurst (*) > rest and or.
    multiset
    ORA-06550: line 40, 12 colum:
    PLS-00103: symbol 'W_SUPPORT_Y' met instead of one of the following symbols:

    . (), * @ % & = - + <>/ is mod remains not rem
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | mult
    ORA-06550: line 41, colum 9:
    PLS-00103: symbol 'END' met instead of one of the following symbols:

    . (), * @ % & = - + <>/ is mod remains not rem
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | multiset members
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:

    I checked the line number, but do not see the error in my code.

    Please could you help me?

    peace

    Hello

    glad to know that it worked. In fact, I don't see the reason to make these complicated processes.

    Remember the mantra:

    • If you can do it with SQL then do it with SQL

    Good evening!

    Alberto

  • Declare a type of table with multiple columns

    I have a table with a column of type, and I want to create one with two columns.

    My type is:
    create or replace type "NUMBER_TABLE" in the table of the number;

    And I use it in function:

    FUNCTION GetValues()
    return NUMBER_TABLE
    as
    results NUMBER_TABLE: = NUMBER_TABLE();
    Start
    Select OrderId bulk collect in: results from (select * from tbl_orders);
    -Other code...
    end;

    I want select it be like this:
    Select OrderId, OrderAddress bulk collect into: results from (select * from tbl_orders);

    How to do this?

    Is that what you are looking for:

    CREATE OR REPLACE TYPE two_col_rec AS OBJECT (empno NUMBER, ename VARCHAR2(10))
    /
    
    CREATE OR REPLACE TYPE two_col_table AS TABLE OF two_col;
    /
    
    CREATE OR REPLACE FUNCTION GetValues RETURN two_col_table AS
       results two_col_table := two_col_table();
    BEGIN
       SELECT two_col(empno, ename) BULK COLLECT INTO results FROM emp;
       --
       RETURN results;
    END;
    /
    show errors
    
  • Two columns of text in a text box. How?

    Hello everyone.

    I came across a paragraph styles video trick that shows two areas of text with two columns in them, and I can't understand how they were made. The first text box displays a game schedule, only the second poster dummy text. At first, I thought they were two of linked text boxes with hidden edges, but then I realized that they were not as you can see the box to run across the two columns of text. Check out the video so that you can see what I mean. Can someone help me please?

    http://vector.tutsplus.com/tutorials/Tools-Tips/Quick-Tip-paragraph-styles/

    Thank you very much in advance!

    Daniel

    Hi Daniel,.

    With your selected area type object, you can go to Type > area Type Options... and change your settings for column y.

    KGB

  • Problem with 2 columns.

    , I work with Dreamweaver 8 through the tutorials to create a web site with two columns.  Of course, I'm a newbie.  Below is the code in my CSS file, but my main problem is that when I added the "left margin" my selector "#content" it does not separate the column, the content is always leaning on my sample image.  Can someone identify an error in the code because I am confused.  The sample site is http://mediatracks.com/basiclayout1.html If that helps.

    Thank you in advance.

    HTML, body, ul, ol, li, p, h1, h2, h3, h4, h5, h6, form, fieldset {}

    margin: 0;

    padding: 0;

    border: 0;

    }

    {body

    background-color: #666666;

    color: #666666;

    fonts: 80% Verdana, Arial, Helvetica, without serif.

    margin: 0px;

    padding: 0px;

    text-align: center;

    }

    {#wrapper}

    width: 770px;

    background-color: #FFFFFF;

    margin: auto 10px;

    border: 1px solid #000000;

    text-align: left;

    }

    #banner {}

    height: 110px;

    background-image: url (.. / graphics/bmw.jpg);

    background-repeat: no-repeat;

    }

    #nav {}

    border-bottom: 1px solid #000000;

    }

    #nav ul {}

    padding: 0;

    margin: 0;

    background-color: #00FF99;

    }

    #nav ul li {}

    display: inline;

    padding: 0;

    margin: 0;

    }

    #nav ul li a {}

    do-size: 80%;

    color: #FFFFFF;

    background-color: #3333CC;

    text-decoration: none;

    Padding: 25px 0 0 25px;

    border-right: 1px solid #000000;

    text-align: center;

    Width: 9è;

    }

    #nav ul li a: hover, #nav ul li a: focus {}

    background-color: #990000;

    }

    #content p {}

    margin left: 200px;

    margin: 20px;

    }

    #content h1 {}

    color: #003366;

    padding: 0;

    margin: 20px;

    }

    #content h2 {}

    color: #003366;

    padding: 0;

    margin: 20px;

    }

    {.leftimage}

    float: left;

    margin: 20px 0 10px 0;

    border: 1px solid #000000;

    }

    {.rightimage}

    float: right;

    margin: 0 0 20px 15px;

    border: 1px solid #000000;

    Width: 150px;

    }

    {.clearit}

    display: block;

    clear: both;

    }

    #footer {}

    border-top: 1px solid #000000;

    background-color: #003366;

    color: #FFFFFF;

    }

    #footer p {}

    -font size: 70%;

    padding: 3px;

    }

    {#leftcol}

    margin-left: 10px;

    top of the margin: 20px;

    float: left;

    Width: 170px;

    height: 150px;

    background-color: #FFFF00;

    }

    You are welcome!

    and for learning, please refer to the following links:

    http://www.dynamicdrive.com/style/layouts/category/C9/

    http://www.456bereastreet.com/lab/developing_with_web_standards/csslayout/2-Col/

    Kind regards

    Vinay

  • ComboBox with multiple columns

    Is it possible to make a ComboBox with two columns in the drop-down list box?

    Thank you

    Use the dropdownwidth property

  • Conversion of an array of unique column in a table of two columns

    Hello world

    What I'm trying to do is to convert a single column table in a table with two columns. Here is an example:
    Table (column):
    ID1
    ID2
    ID3
    ID4
    ID5

    Table B (two columns) must be:
    ID1 ID2
    ID3 ID4
    ID5

    I've been browsing through a cursor and do an insert every 2 rows, but do not like performance.
    Is there a more easy/fast way to do this?

    Thanks in advance
    Oscar
    with t as (
               select 'ID1' col1 from dual union all
               select 'ID2' from dual union all
               select 'ID3' from dual union all
               select 'ID4' from dual union all
               select 'ID5' from dual
              ) -- end of sample table
    select  col1,
            col2
      from  (
             select  col1,
                     lead(col1) over(order by col1) col2,
                     row_number() over(order by col1) rn
               from  t
            )
      where mod(rn,2) = 1
    /
    
    COL COL
    --- ---
    ID1 ID2
    ID3 ID4
    ID5
    
    SQL> 
    

    SY.

Maybe you are looking for

  • Is there a switch to start minimized FF?

    I'm looking for a command line switch that will start Firefox kept to a minimum.Thunderbird too, if possible

  • Active window loses focus

    All past this problem recently. It began not with an upgrade of the OS, if I had just restarted the computer after having been passed away on a trip. The active window, I have been working in suddenly loses focus, sometimes in the middle of a Word, I

  • MBP mid 2010Kernel panic (with log)

    Hi all, I have a MBP 15 "mid-2010, running OS X Yosemite. I had two in the last days kernel panic, while working on Microsoft Excel 2016, a few minutes after waking from the stop. It wasn't the first time I had this kind of problem, I had a month ago

  • Windows Media Player ActiveX control causes memory leak

    I'm writing an application that will load and play *.avi files in an ActiveX control. The user must be able to load multiple files consecutively in the single player mode. However, it seems to be the memory leak every time that a file is loaded, even

  • The title of a display of formatting

    I create a custom view, but I have a problem that you are trying to add a line break and white space in the Template "String".  How can you do this or is this not possible?  Thank you.