How add my data in comboBox

hi master
sir this is my class give my right result in textarea
bu i need my result in comboBox
please give me idea how i add my result in combo box
this line add data in taxarea
allRowValues.append("ROW "+ rset.getString("title") + "\n");
how i add in combo
=========
import javax.swing.JApplet;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.JButton;
import java.awt.Rectangle;
import javax.swing.JTextArea;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.*;
import javax.swing.JLabel;
import java.util.Properties;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class apcl extends JApplet {
/** Initialization method that will be called after the applet is loaded
* into the browser.
private JComboBox Selector;
private String [] ColorList;
private JButton DbConnect = new JButton();
private JTextArea empValues = new JTextArea();
private Connection con;
private JLabel jLabel1 = new JLabel();
public apcl() {
public void init() {
try {
jbInit();
} catch(Exception e) {
e.printStackTrace();
private void jbInit() throws Exception {
this.getContentPane().setLayout(null);
DbConnect.setText("Click to Connect to DB");
DbConnect.setBounds(new Rectangle(90, 225, 175, 40));
DbConnect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
connectToDB(e);
empValues.setBounds(new Rectangle(40, 50, 310, 150));
jLabel1.setText("Emp Records :");
jLabel1.setBounds(new Rectangle(45, 20, 155, 20));
this.getContentPane().add(jLabel1, null);
this.getContentPane().add(empValues, null);
this.getContentPane().add(DbConnect, null);
private void connectToDB(ActionEvent e) {
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:aamir","muhammad","mfa786");
con = DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
empValues.setText("...Connected to the Database.Fetching Values from DEPT Tables.....\n");
fetchValues();
} catch (SQLException ex) {
System.out.println("Connection Error = " + ex.toString());
public void fetchValues() {
try {
Statement stmt = con.createStatement();
StringBuffer allRowValues = new StringBuffer();
int counter = 1;
ResultSet rset = stmt.executeQuery("SELECT accid,title FROM chartofacc");
while (rset.next())
//allRowValues.append("ROW " + counter + " ENAME = " + rset.getString(1) + " & ENO = " + rset.getString(2) + "\n");
allRowValues.append("ROW "+ rset.getString("title") + "\n");
counter++;
empValues.setText(allRowValues.toString());
rset.close();
stmt.close();
con.close();
} catch (SQLException ex)
System.out.println("Error While Fetching Values = " + ex.toString());
======
please give me idea how i add data in combobox
thank
aamir

Three times in the past I've asked you to use the "Code" formatting tags when posting code so the code is formatted and readable.
Three strikes and your out. No code tags, no help.

Similar Messages

  • How to add the data to combobox

    how to add data directly into
    info swing component jcomboboxcontrol in jdevloper.
    can any one help.
    thanks
    sweety

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by pullareddyj:
    u just addlike following method for insert
    data in combobox.
    "comboBoxControl1.addItem("jan");"
    pullareddy<HR></BLOCKQUOTE>
    THANKS
    SWEETY

  • How to display data in ComboBox when click on DataGrid Row.

    Hi!
         I am new to Adobe Flex. I am building one Project that was related to Comapny and Customer. First I created Company Master. Then I create Customer Master successfully and My Backkend is SQLite Database.
         My Problem is I have two files one is CustomerMaster and second one is CustomerForm.
         In CustomerMaster I have a datagrid in that data was displaying thru Array Collection. When ever we doublick on datagrid row it's displayed a CompanyForm. CompanyForm  contains TextFiled and ComboBox. TextFiled populating data but Combobox doesnot. It display always prompt message.
          Please help.
    Thanks,
    Sree Kumar

    Hi! Vibhuti Gosavi,
                          First of all thanks for your quick reply. Already I saw that link.
    Actually, In CustomerForm successfully store the information into the database. While retrieving the data problem cames. Sample Code:
    CustomerMaster:
    private function createItem():void
                                            openTab(new Object());
                                  public function openTab(customer:Object):void
                                            var children:Array = tn.getChildren();
                                            var length:int = children.length;
                                            for (var i:int = 0; i<length; i++)
                                                      if (children[i].customer.customerId == customer.customerId)
                                                                tn.selectedIndex = i;
                                                                return;
                                            var form:CustomerForm = new CustomerForm();
                                            tn.addChild(form);
                                            form.customer = customer;
                                            form.dao = dao;
                                            form.addEventListener(CustomerEvent.CREATE, customerChangeHandler),
                                                      form.addEventListener(CustomerEvent.UPDATE, customerChangeHandler),
                                                      form.addEventListener(CustomerEvent.DELETE, customerChangeHandler),
                                                      tn.selectedChild = form;
                                  private function customerChangeHandler(event:CustomerEvent):void
                                            customerArrayList = dao.findByCustomerAll();
                                            if (event.type == CustomerEvent.DELETE)
                                                      tn.removeChild(event.target as CustomerForm);
                        ]]>
              </fx:Script>
              <mx:Canvas id="container" left="12" right="12" top="12" bottom="12">
                        <mx:Canvas left="0" top="2" right="0" height="33">
                                  <mx:Button id="AddCustomer" x="1" width="108" height="32" click="createItem()"
                                                         icon="@Embed('assets/icon_plus.png')" label="Add Customer" toolTip="Add Customer"
                                                         verticalCenter="-1"/>
                        </mx:Canvas>
                        <code:SuperTabNavigator id="tn" x="0" y="39" width="681" height="197"/>
                        <mx:DataGrid id="customerList" x="1" y="262" width="680" height="231"
                                                       dataProvider="{customerArrayList}"
                                                       doubleClick="openTab(customerList.selectedItem)" doubleClickEnabled="true">
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="customerId" headerText="Id"/>
                                            <mx:DataGridColumn dataField="customerName" headerText="Name" />
                                            <mx:DataGridColumn dataField="companyName" headerText="companyName" />
                                  </mx:columns>
                        </mx:DataGrid>
              </mx:Canvas>
    CustomerForm:
    public function set customer(customer:Object):void
                                            this._customer = customer;
                                  public function get customer():Object
                                            return this._customer;
                                  private function saveCustomer():void
                                            if (Validator.validateAll(customerValidators).length>0)
                                                      return;
                                            _customer.customerName = customerName.text;
                                             _customer.companyName = companyName.text;
                                            if (_customer.customerId > 0)
                                                      updateCustomer();
                                            else
                                                      insertCustomer();
                                  private function insertCustomer():void
                                            try
                                                      Alert.show(_customer.normalPkts);
                                                      dao.insertCustomer(_customer);
                                                      customerId.text = _customer.customerId;
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.CREATE, _customer, true));
                                                      var alertText:String="Company Created Successfully!";
                                                      Alert.show(alertText,"",4,null,null,ConfirmMessage);
                                            catch (error:SQLError)
                                                      var alertErrorCreate:String="Company not Created...";
                                                      Alert.show(alertErrorCreate+"\n"+error.details,"",4,null,null,ErrorMessage);
                                  private function updateCustomer():void
                                            try
                                                      dao.updateCustomer(_customer);
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.UPDATE, _customer, true));
                                                      var alertText:String="Company Updated Successfully!";
                                                      Alert.show(alertText,"",4,null,null,ConfirmMessage);
                                            catch (error:SQLError)
                                                      var alertErrorText:String="Company not Updated...";
                                                      Alert.show(alertErrorText+"\n"+error.details,"",4,null,null,ErrorMessage);
                                  private function deleteItem():void
                                            try
                                                      dao.deleteCustomer(_customer);
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.DELETE, _customer, true));
                                            catch (error:SQLError)
                                                      Alert.show(error.details, "Error");
                        ]]>
              </mx:Script>
       <mx:Grid x="10" y="10" width="665" height="130" verticalAlign="middle">
                        <mx:GridRow width="665" height="100%">
                                  <mx:GridItem width="85" height="100%">
                                            <mx:Label width="85" text="Customer Id:"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="115" height="100%">
                                            <mx:TextInput id="customerId" text="{_customer.customerId}" editable="false" width="115"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="102" height="100%">
                                            <mx:Label width="102" text="Company Name:"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="100" height="100%">
                                            <mx:ComboBox id="companyName" dataProvider="{companyIdList}" labelField="companyName"
                                                                           prompt="Select..." text="{_customer.companyName}" width="100"/>
                                  </mx:GridItem>
                          <mx:GridItem width="230" height="100%" horizontalAlign="center" verticalAlign="middle">
                                            <mx:Button label="Save" click="saveCustomer()"/>
                                            <mx:Button label="Delete" click="deleteItem()"/>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
    =====================================================================
    I have two ArrayCollections 1) companyIdList (CustomerForm)
                                              2) customerArrayList(CustomerMaster)
    please go through the bold text. Please focus on two dataProviders. These dataproviders are binding for One Combo Field.
    Thanks,
    Sree Kumar
    Message was edited by: sreekumar1976

  • How to getFocus in a ComboBox without choosing the inside data?

    How to getFocus in a ComboBox without choosing the inside data? Once I clicked on the ComboBox, I couldnt get the focus unless I choose the data inside. Although I had tried with many different types listeners, but still couldnt get it. Could anyone help me???

    It is easier to work with the JComboBox in 1.4 for what you want to do.
    But try this and see if it works for you. I added a FocusListener to all the other components on the panel, and had them close the combo box popup list. Now, if another component previously had the focus, it would take 2 clicks to have the combo box's list pop up. It's quite round-about, but it seems to work.
    I also printed a message on the console.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class ComboBoxPopupTest
       public static void main( String [] args )
          final JComboBox comboBox = new JComboBox( new Object [] { "one", "two",
                                           "three", "four" } );
          JButton button = new JButton( "huh" );
          JButton button2 = new JButton( "Yo, baby!" );
          final JPanel panel = new JPanel();
          final Runnable hidePopup =
             new Runnable()
                public void run()
                   // This method is deprecated in 1.4.
                   // But you won't need it in 1.4 anyway...
                   Component comp = SwingUtilities.findFocusOwner(panel);
                   if ( comp != null )
                      if ( comp.getClass().toString().indexOf("ComboBox") > -1 )
                         comboBox.setPopupVisible( false );
                         System.out.println( "helloooo comobox" );
             }; // end the Runnable
          FocusListener focusListener = new FocusAdapter() {
             public void focusLost( FocusEvent evt )
               SwingUtilities.invokeLater( hidePopup );
          // In Java 1.4, just add a focus listener to the combo box
          // instead of adding it to all the other components.
          button.addFocusListener( focusListener );
          button2.addFocusListener( focusListener );
          panel.add( comboBox );
          panel.add( button );
          panel.add( button2 );
          JFrame frame = new JFrame( "Hello" );
          frame.getContentPane().add( panel, BorderLayout.CENTER );
          frame.setSize( 400, 300 );
          frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
          frame.setVisible( true );
    }Tell me if that works for you.

  • How to add the date field in the dso and info cube

    Hi all.
    I am new to bi 7. in the earlier version v hav to button to add the date field. but in the bi 7 der is no option so can any body tell me how to add the date field in the data targets
    Thanks & Regard
    KK

    my prob is solved
    KK

  • How do I erase a CD read/write disc on my macbook so I can add new data

    help!
    How do I erase a CD read/write disc on my macbook so I can add new data. If a disc is a RW, I shouldn't i be able to write to it after it already has some data on it?
    I get a screen note saying I can't add anything because something is already on the disc... but it's only one little 3 meg file. But apple i info. shows no room on the cd.
    How can I erase the cd and reuse it? I find no erase command and when I try to drag the file to the trash, i get another note saying i don't have permission... even tho I've check off the permission box.
    sheesh.

    Open Disk Utility, choose the CD on the left side and click "Erase" on the right.
    Matt

  • How do I add simple text to a photo? For example, if I took a photo of a chalk board and wanted to add a date via Lightroom making it look like it was written on the chalk board, how would I do that?

    I simply need to know how to do this. Everything online talks about doing this as a watermark feature or during Export only. I need to know how to do this during the Develop stage, if it's possible.
    I took a photo of a couple for a pregnancy announcement shoot. We added a chalk board that had the date the birth is to take place written on it, but it didn't show as well when I reviewed the first couple pics. So I erased the chalk board thinking that I could just add the date via Lightroom, but I have been unable to figure it out. Any help would be very much appreciated.

    To create a graphic watermark or identity plate for this purpose with a hand written chalk look you would need Photoshop or Elements to create a transparent PNG file so you might as well do the whole thing in one of those programs to start with.  You can't do this in the develop stage anyway like you requested.

  • ITunes is saying that I have over 4.78 GB under the category of "other", making it so my iPhone 4 can't add any data (music, apps, pictures, etc.). I'm currently using only 1.3 GB of storage on my iPhone, and the rest is "other". How do I fix this?

    iTunes is saying that I have over 4.78 GB under the category of "other", making it so my iPhone 4 can't add any data (music, apps, pictures, etc.). I'm currently using only 1.3 GB of storage on my iPhone, and the rest is "other". How do I fix this?

    Not if you sync your contact to itunes using the program provide i.e outlook..etc

  • HOW DO I ADD A DATE IN THE FOOTER?

    I can not find the INSERT DATE function to add a DATE to the footer of a NUMBER spreadsheet.  How do I do that? 

    Bob,
    Further to Jerry's pointer, see this thread for a description of how you can set up an 'insert date' pick in your menu.
    If you want (thanks to Badunit for showing that this was possible) instead of going through the steps described there you can just grab a copy of the service via this link (automatic download from Dropbox).  When you doubleclick it, you'll be asked if you want to install it. You may have to go to System Preferences > Security & Privacy to click 'open anyway' if you get a warning message.
    That's it. After it's installed it will be a menu pick similar to the screenshot above.
    If you want to rename it, then in Finder hold down the option key choose Go in the menu, navigate to Library > Services and rename it there as you would any other file.
    If you don't like going to the Services menu then assign a keyboard to it at System Preferences > Keyboard > Shortcuts.
    SG

  • How to add PO date and Vendor name in SAP table MB5S

    How do I add PO date field and Vendor name field in SAP table MB5S?? Kindly Help

    As a general recommendation just tell the ABAPer your requirement, don't tell him how to do it.... he probably knows, or should know, better ways of doing something then a functional consultant.
    And please don't tell people to copy standard reports, most of the times there is a BADI, enhancement, or an implicit enhancement spot available. I'm a consultant who can program ABAP (including complex programs), and I've never had to copy a standard program. Ever.
    PS: And no, I didn't have to register the object for modification either.
    EDIT: I went to check the program and you have two explicit enhancement spots to use:
    ENHANCEMENT-POINT read_data_01 SPOTS es_rm07msal - You use this to fill the extra fields of itab;
    ENHANCEMENT-POINT EHP605_RM07MSAL_03 SPOTS ES_RM07MSAL - You use this to enhance the field catalog of the ALV if you are on EhP5, if not create an implicit enhancement on the same stop.
    Current SAP allows enhancements everywhere, copying programs should be forbidden.

  • Compiling form data: how to add FDF data?

    Hi there
    I've created a PDF form and am testing the distribution and compilation process. I created the form in Acrobat. I suspect most of the end users will have Reader, so after having distributed it through the Acrobat wizard (to myself) I filled it in with Reader and sent it back (the FDF file).
    When I open this FDF file from my email application, it doesn't automatically add it to the data set created in the distribution process. Instead it says that the data file cannot be located and asks if I'd like to browse for it. I do so, find it, and the completed form opens in Reader, not Acrobat. I can get around this by ctrl-clicking in Mail and telling it to open with Acrobat.
    However, when I do manage to get the completed form open in Acrobat it does not add the data to the spreadsheet field at the top. If I try to Import Data, the FDF file is greyed out – it wants a PDF. And if I import the FDF by going to Forms > Manage form data > Import data..., it shows the completed form but not the data in the spreadsheet again.
    So, how can I add this FDF data to the data set and get it to display in the spreadsheet area? Alternatively, how can I save this completed form as a PDF (not a data set as happens if I go File > Save) so that I can import that into the data set?
    I hope I've explained it clearly enough! Any help would be appreciated.

    Priya,
    Preview the iview and try shiftright click or ctrlright click and add the additional fields.
    if it doesnot work then you need to customise the code as per the requirements.

  • How to add one date column and charecter column

    hi all,
    i have 3 column start_date(date),end_date( date),duration (varchar2)
    i am trying to add start_time and duration like this
    end_date := to_char(start_time) + duration;
    but its showing value_error
    how to add one date column and charecter column.
    Thanks

    you need something that does:
    end_date (DATE) := start_date (DATE) + <number of
    days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
    e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
      2  -- END OF TEST DATA
      3  select start_dt + duration_days
      4* from t
    SQL> /
    START_DT+
    04-JUL-07

  • How do you add a date/time stamp to photo before printing?

    How do you customize a photo?  I want to add a date to a photo before printing.

    Some Image Editors That Support layers:
    Photoshop Elements 11 for Mac - $79
    GraphicConverter - $40
    Rainbow Painter - $30
    Imagerie - $38
    Acorn - $50
    Pixelmator - $60 
    Seashore - Free
    GIMP for Mac - Free
    Xee 2.1 - free
    OT

  • How to add IPTC data to multiple photos w/o overwriting other data?

    I need to see if there's a way to add IPTC data to one or more fields to mulitple photos without disturbing the other fields' data that's already there. For example, I've keyworded & captioned my images, but now would like to add the City or the Country to all the shots, or a group of shots.
    Conventional Lift & Stamp will override the keyword & caption field info on the stamped images, which I don't want. How to I lift & stamp other select fields? I sure don't want to have to type in the city or country on hundreds/thousands of images!
    Randy
    Power Mac G5, dual 2.5, 2.5 gb   Mac OS X (10.4.4)  

    Thanks for the reply.
    In the Lift & Stamp HUD, under the IPTC heading,
    there's no way to de-select the sub-categories of
    Caption & Kepyword, leaving just State (or other
    fields which don't seem to be even present). One can
    de-select the major categories of Keywords, Caption,
    IPTC, etc. but not the subcategories. This is the
    problem I'm running into -- no way to just add
    additional data in select fields.
    Unless I'm missing something.
    Indeed! Aperture does not make this at all obvious, but with any line highlighted in the Lift & Stamp HUD just hit the "delete" key and that line is gone. If you delete a category (line with a checkbox) the whole category goes, if you expand a category you can delete individual lines, whatever you like. Also very handy for adjustment stamping when you don't want to stamp a clone job, just white balance.
    It remembers what you have removed until you do another Lift.

  • How to add two date format in web i report.

    Hi Every One,
                     I have Fields like Start Date,New Date, Close Date, End date balance.
    that Fields all are in date format like start date(05/05/14), New date(06/05/14),Close date(09/05/14)
    But i need result (start date+new date)-close date=enddate balance .
    How will achieve this requirement in web i please replay me.

    Hi Stefen Jay,
    For suppose, let us assume you have START DATE, NEW DATE and CLOSE DATE as mentioned below.
    And please make sure that all START DATE, END DATE, NEW DATE are in same format.(MM/dd/yyyy)
    Now first you need to add start date and new date. Create a variable
    Start Date & New Date  = RelativeDate([Start Date];DayNumberOfMonth([New Date]))  // Gives 5/11/14 as result.
    And now subtract Close Date from the above result using this formula.
    End Date = RelativeDate([Start Date & New Date];-DayNumberOfMonth([Close Date]))  //Gives 5/2/14 as result.
    Find below screenshot for reference.
    Regards,
    G Sujitha

Maybe you are looking for

  • Can't move text in Acrobat 9

    We create a document in Word 2007 and save as .pdf.  We then use the text touch up tool to edit certain text and to move certain text.  We used to do this in Acrobat 5 without an issue, but in Acrobat 9 there are no handles on the text boundary after

  • Browse to source image not letting me change images on a page

    So - say I have an image on a page; let's call it "one.jpg". If I want to replace it with "two.jpg", I would normally just click the little folder icon in the properties menunext to the Src field, and choose the new image. Done it a million times. Bu

  • How can I make the sort default "by date" in iPhoto?

    On one of my computers, every time I load an event, it goes to the top of the library and I have to go to "sort/by date" to get it to go to the end or bottom of the library...where I want it. On my other computers, the default seems to be "by date" n

  • Fixed length select list fields

    Is it possible to fix the width of a Select List field? I don't want it to auto-resize to the max width of the values in that column, but see no way to do that on the page editor. Thanks.

  • Infotype data clear

    I want to clear all data from infotype 2005 pl do help. reward points will be given. Regards, Quavi.