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
Related Q & A:
- How To Write A Resume?Best solution by Yahoo! Answers
- How To Write A Letter?Best solution by Yahoo! Answers
- How to match a drawn Chinese character to a database of stroke animations?Best solution by Signal Processing
- How long should I give a prof to write a letter of recommendation for a graduate school application?Best solution by Yahoo! Answers
- How to write a persuasive letter to a bank?Best solution by wikihow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.