Why can't I add items to the database?

How to write a JcomboBox selected item to a database?

  • I'm playing around with openbravopos application in java and I need a little help please. I made a ComboBoxModel to have several items I have something like this: prodtypesent = dlSales.getProductList(); prodtypemodel = new ComboBoxValModel(); prodtypemodel.add(AppLocal.getIntStrin… prodtypemodel.add(AppLocal.getIntStrin… prodtypemodel.add(AppLocal.getIntStrin… prodtypemodel.add(AppLocal.getIntStrin… m_jProductType.setModel(prodtypemodel)… And it's working fine; it's writing to the database the respective strings when selected. My question is that I have to write to the database not the string but The first letter of it: Something like string combo.others=Something what I need is to write S in the database. Can anyone help me out?

  • Answer:

    I'm not sure I understand. Do you want just the first letter of a Java String? I've never used Openbravo POS but if it lets you use regular Java, you can just substring the String? String others= "Something"; others.substring(0,1); Not all your example code is displaying but if "AppLocal.getIntStrin…" returns a string, could you just: AppLocal.getIntString .substring(0,1) (remove the space before the . period above)

blueshad... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.