Is there a Java utility class to help with data management in a desktop UI?

Is there a Java utility class to help with data management in a desktop UI?
I am writing a UI to configure a network device that will be connected to the serial port of the computer while it is being configured. There is no web server or database for my application. The UI has a large number of fields (50+) spread across 16 tabs. I will write the UI in Java FX. It should run inside the browser when launched, and issue commands to the network device through the serial port. A UI has several input fields spread across tabs and one single Submit button. If a field is edited, and the submit button clicked, it issues a command and sends the new datum to the device, retrieves current value and any errors. so if input field has bad data, it is indicated for example, the field has a red border.
Is there a standard design pattern or Java utility class to accomplish the frequently encountered, 'generic' parts of this scenario? lazy loading, submitting only what fields changed, displaying what fields have errors etc. (I dont want to reinvent the wheel if it is already there). Otherwise I can write such a class and share it back here if it is useful.
someone recommended JGoodies Bindings for Swing - will this work well and in FX?

Many thanks for the reply.
In the servlet create an Arraylist and in th efor
loop put the insances of the csqabean in this
ArrayList. Exit the for loop and then add the
ArrayList as an attribute to the session.I am making the use of Vector and did the same thing as u mentioned.I am using scriplets...
>
In the jsp retrieve the array list from the session
and in a for loop step through the ArrayList
retrieving each CourseSectionQABean and displaying.
You can do this in a scriptlet but should also check
out the jstl tags.I am able to remove this problem.Thanks again for the suggestion.
AS

Similar Messages

  • Shuttle.java util class

    Can you please tell me where i can download the Shuttle.java util class to work with shuttle component in adf faces.
    we haveAdfUtils and JsfUtils, like these classes i want to work with shuttle component by means of util class.
    Thanks
    satya

    AdfUtils and JsfUtils classes have most of the required methods. I'm not sure about shuttle.java util class.
    http://www.gebs.ro/blog/oracle/oracle-adf-select-many-shuttle/

  • Need Help with data type conversion

    Hello People,
    I am new to java, i need some help with data type conversion:
    I have variable(string) storing IP Address
    IPAddr="10.10.103.10"
    I have to call a library function which passes IP Address and does something and returns me a value.
    The problem I have is that external function call in this library excepts IP Address in form of a byte array.
    Here is the syntax for the function I am calling through my program
    int createDevice (byte[] ipAddress).
    now my problem is I don't know how to convert the string  IPAddr variable into a byte[] ipAddress to pass it through method.

    Class InetAddress has a method
    byte[]      getAddress() You can create an instance using the static method getByName() providing the IP address string as argument.

  • Need Help with Dates

    I am printing a calendar and certain events will be helds on certain dates.
    One can edit the event if it has not passed the date. Events in the past can be viewed but not edited.
    When I query the database the date must be formatted dd-MMM-yy
    I am able to get today's date by doing this:
    java.util.Date today = new java.util.Date();
    String formatString = "dd-MMM-yy";
    SimpleDateFormat sdf = new SimpleDateFormat(formatString);
    String today_str = sdf.format(today);
    My code for printing the calendar: I left out some of the table formatting in the JSP page.
    GregorianCalendar d = new GregorianCalendar();
    int today = d.get(Calendar.DAY_OF_MONTH);
    int month = d.get(Calendar.MONTH);
    d.set(Calendar.DAY_OF_MONTH,1);
    int weekday = d.get(Calendar.DAY_OF_WEEK);
    for(int i = Calendar.SUNDAY; i < weekday; i++)
    out.print("<td> </td>");
    do {
    int day = d.get(Calendar.DAY_OF_MONTH);
    out.print("<td>" + day + "</td>");
    String formatString = "dd-MMM-yy";
    SimpleDateFormat sdf = new SimpleDateFormat(formatString);
    //if(event exists on this day
    // Get results
    // print link for viewing
    // if (after today) print link for edit
    if(weekday == Calendar.SATURDAY)
    out.println("</tr><tr valign=top>");
    d.add(Calendar.DAY_OF_MONTH,1);
    weekday = d.get(Calendar.DAY_OF_WEEK);
    } while(d.get(Calendar.MONTH) == month);
    if(weekday != Calendar.SUNDAY)
    System.out.println();
    The part I need help on is this:
    //if(event exists on this day
    // Get results
    // print link for viewing
    // if (after today) print link for edit
    I'm looping through each day of the month to print the days. I have the month, day, year as integers. How can I create a date object out of that and compare it to today's date to test if it's before or after today???
    All the function in the Date class that I think would do this have been deprecated.

    Need Help with Dates
    Here is some information about dates:
    There are many edible palm fruits, and one of the most widespread and favored of these is the data (Phoenix dactylifera). Dates were cultivated in ancient land from Mesopotamia to prehistoric Egypt, possibly as early as 6000 B.C. Then--as now--dates were a staple for the natives of those dry regions. Much later, Arabs spread dates around northern Africa, and dates were introduced into California by the Spaniards in 1765, around Mission San Ignacio.
    The date prefers dry, hot climates, because date fruits are injured at temperatures of 20 degrees F, and the damp climate of the California coast was not favorable for fruit production. In the mid-1800s, the date industry developed in California's hot interior valleys and in Arizona. Now the date industry in the United States is localized mostly in the Coachella Valley, where the sandy soils permit the plants to be deeply irrigated. Today the new varieties, mostly introduced in this century, produce about 40 million pounds of dates per annum, or over 60% of the dates consumed in this country. The rest are imported mainly from Persia. According to one survey, about one million people are engaged entirely in date palm cultivation worldwide.
    Hope that helps.

  • Help with date validation on input boxes.

    I need some help with date validation on input boxes.
    What I�m trying to create is a form where a user inputs dates and then the rest of the form calculates the other dates for them.
    i.e. � A user inputs 2 dates (A & B) and then a 3rd date which is 11 weeks before date B is calculated automatically.
    Is this possible and if so how do I do it ???
    Thanks

    Hi,
    to get third date try this:
    java.util.Date bDate = ...;
    Calendar yourCalendar = new GregorianCalendar();
    yourCalendar.setTime(bDate);
    yourCalendar.roll(Calendar.WEEK_OF_YEAR, -11);
    java.util.Date cDate = yourCalendar.getTime();Regards
    Ldinka

  • Is there a way to start a Sequence with Task Manager (Windows)

    Hi
    Is there a way to start a Sequence with Task Manager (Windows)?

    Hi,
    That is too bad I can not schedule my action Wizard to run via Windows scheduler... The funney things about is that on the same machine that I have created the Action Wizard and saved to to my desktop via export, when I click on it to run it asks me you want to Import that action to your Acrobat Pro X? Okay or Cancel... That Action is already there in my action Wizard List and I have exported from this same machine and I was trying to see if I can schedule it via this command:
    C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat <C:\Users\Bahram\Desktop\OCRFaxedPDFs.sequ
    Regards,
    Jeff P.

  • Help with dates

    Hello Everybody.
    I need help with de management of dates in my sentence.
    I execute the setence to extract information by dates range.
    but i have a problem, because i need extract the information automatically, the first day of every month.
    the information must be the all last month.
    I dont know, what sentence use.
    The objective is: refresh the date automatically every month.
    This is an example of my sentence, but I need use the field AF_DATE too because this is of date of of production form my information:
    The field af_dat is char.
    WHERE EFM='F' AND AF_DAT BETWEEN 'date1' AND 'date2'
    AND TO_CHAR(AF_TIM,'HH24:MI:SS') BETWEEN
    '05:30:00' AND '23:59:59' OR
    AF_DAT BETWEEN 'date1' AND 'date2'
    AND TO_CHAR(AF_TIM,'HH24:MI:SS') BETWEEN
    '00:00:00' AND '00:45:00'AND EFM='F'
    ORDER BY AF_DAT,AF_TIM;
    Edited by: user10827532 on Jan 23, 2009 7:07 AM

    Hi,
    It looks like you're using two columns, af_dat for the year-month-day, and af_tim for the hours-minutes-seconds.
    A lot of folks would just use one column, and do the kind of range check you want like this:
    WHERE   af_dat_tim >= TRUNC (ADD_MONTHS (SYSDATE, -1), 'MM')   -- Start of LAST month
    AND     af_dat_tim <  TRUNC (            SYSDATE,      'MM')   -- Start of THIS month
    AND     TO_CHAR (af_dt_tm, 'HH24:MI')  NOT BETWEEN  '00:46'
                                               AND      '05:29'

  • Obtaining keys from java.util.TreeMap values (help)

    I don't know how i can obtain the keys from the values in the java.util.TreeMap. I can iterate through the key-values collection, but i don't know how i can specify a value to obtain a key.

    That's because Maps map keys to values, not the other way around. If you want to see what key(s) (there may be none or many) map to a particular value, you must examine all values in the Map. You could instead have two Maps, one to map keys to values and the other to map values to keys.

  • Pretty new to Java can someone please help with an addObject() problem?

    Hi I'm pretty knew to programming and I have an assignment which I've been working on but I am stuck
    I have to create a 'space invaders' style game, and I've got some basics working. I wanted to add a boss enemy, which appears when all other enemies have been destroyed. It kind of works, only the program spawns a seemingly infinite amount of the boss which then creates a 'wipe' effect across the top of the screen.
    Here is my code:
    import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
    import java.util.List;
    public class Space extends World
    * Constructor for objects of class Space.
    public Space()
    // Create a new world with 200x250 cells with a cell size of 3x3 pixels.
    super(200, 250, 3);
    //add class with starstreaks
    addObject(new EmptyBox(),1,1);
    //add player character
    addObject(new Player(), 100, 228);
    //add 4 romulan enemies row 1
    for(int i=0; i<4; i++){
    addObject(new Romulan(), (25 + 50 * i), 15);
    //add 3 klingon enemies row 2
    for(int i=0; i<3; i++){
    addObject(new Klingon(), (50 + 50 * i), 40);
    //add 4 romulan enemies row 3
    for(int i=0; i<4; i++){
    addObject(new Romulan(), (25 + 50 * i), 65);
    //add 3 klingon enemies row 4
    for(int i=0; i<3; i++){
    addObject(new Klingon(), (50 + 50 * i), 90);
    //add 3 shields
    for(int i=0; i<3; i++){
    addObject(new Shield(), (30 + 70 * i), 180);
    *public void act(){*
    List<Enemy> enemies = getObjects(Enemy.class);
    *if(enemies.size()==0 ){*
    addObject(new Borg(), 100, 30 );
    I believe the part in bold is the problem, but I dont know why. Klingon and Romulan are subclasses of the Enemy class. The Borg class is it's own seperate class, but with the exact same functions as Enemy. I made it seperate as I figured it would keep respawning if it was a subclass of Enemy.
    Any ideas?

    Its ok, after more than an hour I've got it.
    I simply added private int bossValue = 0; at the beginning and then changed act to this:
    public void act(){
    List<Enemy> enemies = getObjects(Enemy.class);
    if(enemies.size()==0 && bossValue==0 ){
    //for(int i=0; i<1; i++){
    addObject(new Borg(), 100, 30 );
    bossValue =1;
    }

  • Help With Data Structures (Singly Linked Lists)

    Need help inserting user entered name alphabetically into SSL
    import java.util.Scanner;
    class SLLNode<T> {
        public T info;
        public SLLNode<T> next;
        public SLLNode() {
            next = null;
        public SLLNode(T el) {
            info = el; next = null;
        public SLLNode(T el, SLLNode<T> ptr) {
            info = el; next = ptr;
    class SLL<T> {
        protected SLLNode<T> head, tail;
        public SLL() {
            head = tail = null;
        public boolean isEmpty() {
            return head == null;
        public void addToHead(T el) {
            head = new SLLNode<T>(el,head);
            if (tail == null)
                tail = head;
        public void addToTail(T el) {
            if (!isEmpty()) {
                tail.next = new SLLNode<T>(el);
                tail = tail.next;
            else head = tail = new SLLNode<T>(el);
        public T deleteFromHead() {
            if (isEmpty())
                 return null;
            T el = head.info;
            if (head == tail)      
                 head = tail = null;
            else head = head.next;
            return el;
        public T deleteFromTail() {
            if (isEmpty())
                 return null;
            T el = tail.info;
            if (head == tail)     
                 head = tail = null;
            else {                 
                 SLLNode<T> tmp;   
                 for (tmp = head; tmp.next != tail; tmp = tmp.next);
                 tail = tmp;       
                 tail.next = null;
            return el;
        public void delete(T el) { 
            if (!isEmpty())
                if (head == tail && el.equals(head.info))
                     head = tail = null;     
                else if (el.equals(head.info))
                     head = head.next;   
                else {                   
                     SLLNode<T> pred, tmp;
                     for (pred = head, tmp = head.next;
                          tmp != null && !tmp.info.equals(el);
                          pred = pred.next, tmp = tmp.next);
                     if (tmp != null) {  
                         pred.next = tmp.next;
                         if (tmp == tail)
                            tail = pred;
        public void printAll() {
            for (SLLNode<T> tmp = head; tmp != null; tmp = tmp.next)
                System.out.print(tmp.info + " ");
        public boolean isInList(T el) {
            SLLNode<T> tmp;
            for (tmp = head; tmp != null && !tmp.info.equals(el); tmp = tmp.next);
            return tmp != null;
    class Passengers extends SLL<String>{
         Scanner kb = new Scanner (System.in);
         String name;
         Passengers(){
         void reserveTicket(){
              SLLNode<String> temp;
              System.out.println("Please enter your Last Name");
              name = kb.next();
              if(isEmpty())
                   addToHead(name);
              else
                   if(name.compareTo(head.info) <= 0)
                        addToHead(name);
                   else
                        if(name.compareTo(head.info) > 0){
                             while(head.next == null){
                                  temp = head.next;
                                  name.compareTo(temp.info);
                                       if(name.compareTo(temp.info) <= 0)
                                            temp.info = name;
         void cancelReserve(){
              System.out.println("Please enter your Last Name");
              name = kb.next();
              if(isInList(name)){
                   delete(name);
                   System.out.println("Your reservation has safely been removed");
              else System.out.println("That reservation does not exist");
         void checkReserve(){
              System.out.println("Please enter your Last Name");
              name = kb.next();
              if(isInList(name)){
                   System.out.println("You currently have a reservation for this flight");
                   printAll();
              else System.out.println("Sorry, there is no reservation for this flight under that name");
         void showPassengers(){
              if(! isEmpty())
                   printAll();
              else System.out.println("There are no passengers for this flight");
    class Program2_19{
         public static void main(String[] a) {
              Passengers passList = new Passengers();
              Scanner kb = new Scanner (System.in);
              int choice;
              int option = 1;
              while(option == 1){
                   System.out.println("Push 1 to Reserve a ticket");
                   System.out.println("Push 2 to Cancel a reservation");
                   System.out.println("Push 3 to Check reservations");
                   System.out.println("Push 4 to Display all passengers");
                   choice = kb.nextInt();
                   System.out.println();
                   if(choice == 1)
                        passList.reserveTicket();
                   else if(choice == 2)
                        passList.cancelReserve();
                   else if(choice == 3)
                        passList.checkReserve();
                   else
                        passList.showPassengers();
              System.out.println("Would you like to perform another action?");
              System.out.println("Press 1 for yes, or 2 for no");
              option = kb.nextInt();
              System.out.println();
    }

    how do i step thru my list to find the correct spot to insert the name...I kno it has to be done with compareTo() but what do i compare the name with?..the node?.. the head? the tail?

  • Help with data access

    Hi,
    I am new to Java and stuck at a problem. Situation is like following-
    package X
    public abstract class A {
         A(int a) { this.a=p; }
         protected int p;
         abstract int func();
    package Y
    public class B extends A{
         B(int b) { super(b); }
         B() {}
         //p is accessible here
         int func() {
              D d=new D();
              d.func2();
        static void main() {
            func();
    public abstract class C extends B{
    public class D extends C implements interface{
         int func2() {}
    }Now my problem is when I try to access p from func2(), I am getting a NullPointerException error. I am not initialising p anywhere through D()'s and B()'s no argument constructor. Is that the problem?

    When you post code it doesn't help when the code doesn't actually reflect the problem.
    The code you posted isn't legal java so given that it won't even compile you certainly can't get a null pointer exception from that. And where you commented the usage of 'p' you can't use it there so that doesn't help with guessing what you actual code might have looked like.
    So all I can do is offer the following general advice.
    Null pointer exceptions occur because a reference is null and it is de-referenced.. Thus if you do a line like the following.
    xxx.p
    Then 'xxx' is the only possible thing that can be null.
    The stack trace of the exception will tell you the exact line that the problem occurred on.

  • Help with Date function in sql query....

    My question I guess is really 2...I'm trying to use the date function as a comparison in my WHERE clause in my sql command.
    1. My date format is dd-MMM-yy eg. (01-Apr-06) ... my problem is the Apr is lower case where my field in the database is 01-APR-06 so when I compare 01-Apr-06 to 01-APR-06 is doesnt find any rows. Is there away that I can make the Apr all upper case so that it is APR.
    2. My second problem is getting this "date" field to work in my sql stmt I keep getting errors and it works fine if I take my attempts at trying to compare the date.
    --------------Date Code----------------------------------------------------------
    <%!
    String getFormattedDate(java.util.Date d)
    SimpleDateFormat simpleDate = new SimpleDateFormat("01-MMM-yy");
    return simpleDate.format(d);
    %>
    <%
    java.util.Date d = new java.util.Date();
    String dateString = getFormattedDate (d);
    %>
    ---------------------------Sql statment------------------------------------------
    ResultSet rset = stmt.executeQuery ("SELECT name " + " FROM table where rdate = '01-APR-06' order by name ");
    Currently Im just hard coding the date but I need to make it so it uses the date code...so....
    rdate should equal the date from the formatted date in upper case
    something like
    rdate = <%= dateString %>
    Thanks in advance for any ideas anyone may have...

    There are sql functions upper & lower.
    SELECT name  FROM table where upper(rdate) = '01-APR-06' order by name Or you could convert the date to a string, and use the toUpperCase & toLowerCase java.lang.String methods. It doesn't make much of a difference--do you want the java compiler to do the string conversion or the database?

  • URGENT HELP WITH DATES

    Hi, I need to compare two dates, so I can get the difference betweem them in hours.

    Try this.. This does it in days but I think you will get the idea..
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Ex1805
         public static void main(String[] args)
              SimpleDateFormat sdf = new SimpleDateFormat("d/M/y");
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              String inputDate;
              Date first = new Date(), second = new Date();
              final long MSInDay = 1000 * 60 * 60 * 24;
              boolean valid;
    // input first date
              valid = false;
              while(!valid)
                   try
                   System.out.print("Enter first date: ");
                   inputDate = br.readLine();
                   first = sdf.parse(inputDate);
                   valid = true;
                   catch(ParseException e)
                        System.out.println("Invalid     date. Please enter again.");
                   catch(IOException e)
                        System.out.println("IO Error");
    // input second date
              valid = false;
              while(!valid)
                   try
                   System.out.print("Enter second date: ");
                   inputDate = br.readLine();
                   second = sdf.parse(inputDate);
                   valid = true;
                   catch(ParseException e)
                        System.out.println("Invalid     date. Please enter again.");
                   catch(IOException e)
                        System.out.println("IO Error");
    //     calculate difference in days
              long milliseconds = second.getTime() - first.getTime();
              double doubleDays = (double)milliseconds / MSInDay;
              int days = (int)(doubleDays + 0.5);
              System.out.println("Number of days: " + days);

  • Need help with dates  please-urgent

    Hi folks, please help me with this if you can.
    I run a weekly job, and need to have my java code create and use 2 dates to capture data for the whole week.
    begin_date mm/dd/yyyy (String) to be 7 days prior to current date
    end_date mm/dd/yyyy (String) to be the currecnt date
    Note: please take into account the cases where the CURRENT_DATE is the first week of the month. As a result the 7 days prior will fall into the previous month. i.e if end_date="06/04/2003" then the begin_date will be "05/29/2003 Thanks a bunch

    http://java.sun.com/j2se/1.4.1/docs/api/index.html
    See the Calendar and DateFormat classes.

  • Please help with data action problems

    Ok, this is driving me nuts, every example I try seems to work half the time...and I can't figure out why.
    I'm using JDeveloper 10g, ADF/UIX/Struts.
    All I want to do is:
    Access the application module for my project in a struts data action.
    a) To manipulate view object where clauses based on request parameters.
    b) Call application module custom methods.
    c) Access request values.
    Sometime the following works after I've been playing around:
    findForward(DataActionContext ctx)
    ViewObject vo = ctx.getBindingContainer().getApplicationModule.findViewObject("myViewObject");
    //whatever with the vo from here
    MOST of the time, I get 500 Server Errors. They state:
    java.lang.NullPointerException
         at mypackage4.DataActi1Action.findForward(DataActi1Action.java:10)
         at oracle.adf.controller.struts.actions.DataAction.findForward(DataAction.java:575)
         at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:152)
         at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:233)
         at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:163)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    I believe this has to do with there not being a binding container for the Data Action. However, I can drag custom methods and view object methods (create/delete...) from the data control palette onto it all I want, and I still get the same errors. I thought I read that it generates one, from the long document:
    Oracle ADF Data Binding Primer and ADF/Struts Overview
    Basically, I read through and am still confused on how I can access the application module reliably. I have some pages that it's work for, but I can't figure out why it doesn't work for others.
    Could someone clear this up for me please?

    I've tried using getBindingContext, get BindingContainer, and a host of others. I can assign iterators to he UI model, the cpx file, but I still can't seem to figure this out.
    I don't see a comparable example in the ones I've downloaded from otn either. Thanks for any help.

Maybe you are looking for

  • IPod touch AND iPod classic not detected by Windows 7 or iTunes, but both are charging fine via USB.

    I already tried uninstalling and reinstalling all the Apple software on my computer but that didn't help whatsoever.  Both devices are fully charged, and I have tried different cables and USB ports, but to no avail.  When I check for the driver softw

  • Data1.cab error

    I cannot install Acrobat Pro ver 6.0 as I keep getting a data1.cab error. It says the cab is corrupt. I have tried to extract the files and indeed there is a corrupt file in the cab. Can I download a cab file for this version or is there something el

  • Calling a servlet from XSQL

    Has anyone successfully called a servlet from xsql? If you have, have you called one from the href in the xsl:stylesheet? null

  • Change grid results background in ssms 2014?

    can you change the background color in ssms 2014? every time I try in enviro font and color>grid results it only changes the font color and not the background color.

  • Unstable Brush Sensitivity Flash CS4

    I have found in my experience with Flash CS4 and using a Wacom tablet or Cintiq that the brush sensitivity is unstable. Sometimes it works, sometimes it does not. As long as I open Flash and do not change the brush size, then the sensitivity stays ju