Convert to JTable, validation, more

Hello everyone,
I'm currently doing my project and a bit short of time. I'm a really bad programmer and struggling with this. There are some things I need help with and would really appreciate your assistance. Here is my program right now, it's not complete just yet: http://www.mediafire.com/download.php?zrkjnmdhduz
1) Why doesn't the dispose() work in PasswordLogin.java?
2) I've been told my current way of displaying the accounts and products is messy and should rather convert it to a JTable. Could someone possibly help me with that/do the code and paste it back to me. I looked at the example on this website but failed :/
3) When deleting an account/product there's no validation if I enter text (and the program crashes). What's the best way to implement some kind of validation?
4) I can't get the order to work. I need to minus the product price off the account balance and lower the product quantity. I've tried a dozen times to get it to work :/
This is currently what I need to do. If there's anything else you guys would recommend me changing/fixing please let me know. I know it sounds like I'm asking for a lot but we were told if we need help with anything we should make use of this forum.
Thank you.

squirreltjie wrote:
I'm currently doing my project and a bit short of time. I'm a really bad programmer and struggling with this. There are some things I need help with and would really appreciate your assistance. Here is my program right now, it's not complete just yet: http://www.mediafire.com/download.php?zrkjnmdhduz
You're probably going to get few takers on this. Please understand that we're all volunteers here and will gladly help, but you have to be willing to put in more effort than you ask of us. This should seem fair when you're asking for free advice, no? You're far better off posting any problem code that you have here in the forum, but if you do, please use code tags (see below), and try to only post code that is relevant to your problem and hopefully code that compiles. This is called an SSCCE or Short, Self Contained, Correct (Compilable), Example. You can read up on this here: SSCCE
2) ... Could someone possibly help me with that/do the code and paste it back to me. ...this == cheating and is frowned upon here. Please create your own code and ask questions about your code.
This is currently what I need to do. If there's anything else you guys would recommend me changing/fixing please let me know. I know it sounds like I'm asking for a lot but we were told if we need help with anything we should make use of this forum.No problem, but please do things the right way and you'll have lots of help. Do things wrong and you'll get scorn. Please also read this link on how to ask good questions. It has helped me in the past and will probably help you too: [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html]
when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. You may want to click on the Preview tab to make sure that your code is formatted correctly. Another way is to place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
[code]
  // your code block goes here.
  // note the differences between the tag at the top vs the bottom.
[/code]

Similar Messages

  • Converting document files of more than 100 Mb?

    Is it true that you cannot convert document files with more than 100 Mb to PDFs because of that limit on Adobe CreatePDF?
    Is there a way of solving this problem e.g. document files with 285 Mb?

    have you tried compressing the images in the original document?  You can probably compress to 200 dpi if they are only for printing.

  • Validating more than one source with one validator

    Dear all,
    Can we use one validator to validate more than one source?
    <mx:StringValidator id="labelVld" source="{nameEntry,
    labelEntry}" required="true" property="text" />
    <mx:Form>
    <mx:FormItem
    label="{resourceManager.getString('Admin','name')}"
    required="true">
    <mx:TextInput id="nameEntry" />
    </mx:FormItem>
    <mx:FormItem
    label="{resourceManager.getString('Admin','label')}"
    required="true">
    <mx:TextInput id="labelEntry" />
    </mx:FormItem>
    I placed more than one value inside the source attribute of
    the mx:StringValidator component but it didn't work. How do I
    handle this kind of issue in Flex? Does anyone has any idea about
    this?
    Many thanks

    I think this is what you're probably looking for:
    http://livedocs.adobe.com/flex/3/html/help.html?content=validators_3.html

  • Validation: more than one Other Source Dimension Member

    Hi BPC Experts,
    Is it possible to identify more than one Other Source Dimension Member in Validation Business Rules settings? For example, we need to use all DataSources that belong to IFRS roll up. If yes, what is the format?
    Thanks.
    Mila

    Resolved. The format is DIMENSION=MEMBER OR DIMENSION=MEMBER.
    For example,
    C_DATASRC=MJ_MANJE OR C_DATASRC=GAAP_03 OR LOB_IFRS=TEST OR LOB_IFRS=IFRS_INSD.

  • JTable: printing  more lines

    I am reusing the code from http://manning.com/sbe/files/uts2/Chapter22html/Chapter22.htm to print a JTable. Is there anyone has any idea how to change the code in order to make the margin narrower for printing more? It is because it prints another page after printing 17 lines.
    public int print(Graphics pg, PageFormat pageFormat, int pageIndex) throws PrinterException{
       if (pageIndex >= m_maxNumPage)
          return NO_SUCH_PAGE;
       pg.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY());
       int wPage = 0;
       int hPage = 0;
       pageFormat.setOrientation(PageFormat.LANDSCAPE);
       if (pageFormat.getOrientation() == pageFormat.PORTRAIT){
          wPage = (int)pageFormat.getImageableWidth();
          hPage = (int)pageFormat.getImageableHeight();
       else{
          wPage = (int)pageFormat.getImageableWidth();
          wPage += wPage/2;
          hPage = (int)pageFormat.getImageableHeight();
          pg.setClip(0, 0, wPage, hPage);
       int y = 0;
       pg.setColor(Color.black);
       Font fn = pg.getFont();
       FontMetrics fm = pg.getFontMetrics();
       y += fm.getAscent();
       y += 20;
       Font headerFont = m_table.getFont().deriveFont(Font.BOLD);
       pg.setFont(headerFont);
       fm = pg.getFontMetrics();
       TableColumnModel colModel = m_table.getColumnModel();
       int nColumns = colModel.getColumnCount();
       int x[] = new int[nColumns];
       x[0] = 0;
       int h = fm.getAscent();
       y += h;
       int nRow, nCol;
       for (nCol = 0; nCol < nColumns; nCol++){
          TableColumn tk = colModel.getColumn(nCol);
          int width = tk.getWidth();
          if (x[nCol] + width > wPage){
         nColumns = nCol;
         break;
          if (nCol + 1 < nColumns)
         x[nCol + 1] = x[nCol] + width;
          String title = (String)tk.getIdentifier();
          pg.drawString(title, x[nCol], y);
       pg.setFont(m_table.getFont());
       fm = pg.getFontMetrics();
       int header = y;
       h  = fm.getHeight();
       int rowH = Math.max((int)(h * 1.5), 10);
       int rowPerPage = (hPage - header)/rowH;
       m_maxNumPage = Math.max((int)Math.ceil(m_table.getRowCount()/(double)rowPerPage), 1);
       TableModel tblModel = m_table.getModel();
       int iniRow = pageIndex * rowPerPage;
       int endRow = Math.min(m_table.getRowCount(), iniRow + rowPerPage);
       for(nRow = iniRow; nRow < endRow; nRow++){
          y += h;
          for(nCol = 0; nCol < nColumns; nCol++){
         int col = m_table.getColumnModel().getColumn(nCol).getModelIndex();
         Object obj = m_table.getValueAt(nRow, col);
         String str = obj.toString();
         pg.setColor(Color.black);
         pg.drawString(str, x[nCol], y);
       System.gc();
       return PAGE_EXISTS;
    }

    i have posted there. moving to Burundi from Canada, where i purchased the computer, is not conducive to calling apple ($$$$$$$$$/bad phone lines) or a conveniently located Apple repair shop (or even internet or electrical grid, for that matter).
    What i hope is that enough internet ire may coax more publicity and perhaps a proper response for a defective manufacturing issue. then, with a viable repair/replacement/warranty extension program, and an actual published/documented solution to the published/documented fault, i can confidently spend the enormous effort/investment to have my computer actually FIXED.
    plus it feels good to vent.

  • Converter vs. Validator

    Hi, i just created some custom validators and converters
    converters got invoked before validators, why?
    am i wrong, when i think:
    the input by a user must be valid (e.g. Email-address)
    before i can convert it to an Email-Object ?
    have an email-address: [email protected]
    it must be converted to an Email-object with properties like:
    name
    host
    topleveldomain
    so my string "[email protected]" must be converted to
    an email-object like this: (in getAsObject()):
    Email.setName("jsf");
    Email.setHost("sun");
    Email.setTopleveldomain("com");my getAsString concatenates the 3 properties of Email to 1 String-object
    so, after dealing so with this stuff, i aksed me, why is Converter before Validator?
    thanks alot!
    Ralf

    You wrote: "the input by a user must be valid (e.g. Email-address)" but this must be done on client -side in JavaScript, because all request values are submitted as Strings. Then you can use your custom converter to Converter "[email protected]" to Email class instance. Then use validator to perform server-side validation.
    Consider "31.3.2004" submited as String to server. Converter converts this String to Date instance and your TodayValidator can do something like :
    Date enteredDate = (Date) component.getLocalValue();
    if (!enteredDate.equals(new Date()) }
    When user typed something like this "233531sass" converter will generate a conversion error.
    See 3.3 of JSF spec: "This section describes the facilities provided by JavaServer Faces to support type
    conversion between server-side Java objects and their (typically String-based)
    representation in presentation markup."
    and 3.5: "A validator�s purpose is to perform checks on the
    local value of the component, during the Process Validations phase of the request
    processing lifecycle. In addition, a component may implement internal checking in a
    validate method that is part of the component class."

  • Convert JSP to valid XML

    Does anyone know a good (preferrably free) tool to convert a JSP file to valid XML format?
    I've tried Tidy, but this tool can convert HTML to XML or XHTML but not JSP to XML. It will check first
    if my JSP file is valid HTML, which it is not (because there are a lot of JSP tags included, which will
    result in valid HTML, but which are not initially).

    I have not heard of a tool converting a JSP file to a valid XSL file. I remember ourselves manually converting a Cold Fusion site to an xsl format with reference to a xml files.. men, very tedious even with an XML Spy on the help and a tool that automatically creates a labels.xml to store all labels and images and access them via the <xsl:value-of> tag.
    if you can't find a tool that converts a jsp file to an xsl/xml file maybe you can remove all those scriplets and covert a pure html file out of it. or better yet, when a JSP file has been processed, it returns a pure HTML file, right? so you can get that pure HTML source code and convert that to xsl/xml using the tool you have then insert the scriplets and other Jsp tags after the convertion.
    I think that would be a lot easier in absence of a tool. rather than going through the saving of all your labels in an xml file and go through all that <xsl:value-of> tags to access your labels.
    by the way, can i know where i can find that tool that converts an HTML file to an xsl/xml file.
    Cris

  • MAC iPod video converting program (that does more than one at a time?)

    hey i am trying to find a free or paid for program that will convert my videos for my ipod for mac.
    i have the mpeg streamclip but it only does one video at a time and i have about 600 music videos i'm trying to do.
    any input?
    thanks

    Try VisualHub
    http://www.techspansion.com/visualhub/
    Is basically an enhanced version of iSquint, which is excellent software.

  • JTable with more cell editors??

    Hi,
    I have a JTbale in which I have two special columns- one with buttons and the other similar to the the color changer from the swing tutorial.
    My question is should I have now two renders and two editors in this situation?
    Tnax

    should I have now two renders and two editors in this situation?You should!
    ;o)
    V.V.

  • Key code valid more then once

    I am wanting to buy the photoshop cs6 and am currently running Microsoft but want to upgrade my laptop by the end of the year to a Mac... Can you only use the keycode once when you purchase it? Should I go and get the new computer now? On that note does anyone recommend which Mac for photo editing I was thinking MacBook pro 15" or should I go the 17"? Thanks

    dlc6734 wrote:
    I am wanting to buy the photoshop cs6 and am currently running Microsoft but want to upgrade my laptop by the end of the year to a Mac...
    Hi dlc
    You can do a "Crossgrade" to change platforms, the information on the process is here, please make sure you read it carefully and understand all the steps. If you have any questions about the process, or are unsure about any of the steps, contact Adobe Customer Service directly, they are the only ones who can give you absolute answers in areas such as this.
    As for which Mac to buy, I work in IT sales so I'll give you a trite "sales" answer, but it's advice I follow myself when I build my own systems; simply buy the most powerful system you can with the budget you have available on the day!
    I assume from the way you've phrased your question that you're not interested in a desktop? Okay, the 17" MacBook Pro is a fantastic machine, but it's a beast to haul around, so if you need to be "mobile" you may want to consider a maxed-out 15" machine, plus a decent - 24" 1920x1200, IPS panel - monitor for when you're working at your desk.
    A good place to start would be to visit Apple and play with the configuration tools for the 15" and 17" machines, plug in the most powerful processors, and fastest hard drives, then see if the $'s are in your budget. A word of advice, do not buy additional RAM from Apple, the prices are outrageous and cannot be justified, buy the machine with the minimum amount of RAM available, then purchase good 3rd party RAM such as Kingston - no, I don't work for Kingston! - and install it yourself, it's easy. In fact, once you've spec'd out a machine, shop it 'round Apple's authorized resellers, I'll pretty much guarantee you'll get a better deal.
    Good luck
    Paul

  • Converting JTable into pdf format

    Hi All,
    I have a fairly big Jtable with more than 100 columns in it. How can create a printable PDF version from it. THe current version of iText doesn't generate it right. It trims after 4 or 5th column.
    I am afraid that I can create a PdfTable from this big Jtable.
    Thanks

    Hi,
    I'm actually using iText and I think you have better to create your table as a PdfPTable. Doing this, you can display all the table : header + rows.
    look at the iText documentation, there are plenty of PdfPTable examples.
    hth

  • I have downloaded a movie which has the extension .m4v.  This will not play on my CD player and I can't find software to convert to a more universal DVD format.  Can anyone help?

    I have downloaded a movie which has the extension .m4v.  This will not play on my DVD player and I can't find software to convert it to a more universal format.  Can anyone help?

    If you've bought a film from iTunes then you can only copy it to a DVD or CD for backup purposes, you won't be able to watch it on a stand-alone DVD player.

  • I have a number of pages with html extension in different files. Is it possible to merge them into one file? Is it possible to convert them into another file type such as PDF, MOBI, or EPUB? Thanks

    While downloading an eBook from internet, I found a book in a folder containing around 123 files, which is equivalent to the number of pages of the book.
    My interest is to bring them together in one file so that I can read it at a time. As the interface is not comfortable with html, I also like to convert it into another more suitable file format.

    Hello djensen1x,
    Could you please let me know what version of Acrobat are you using.
    Also, tell me your workflow of combining those PDF files?
    Please share the screenshot of the error message that you get.
    Hope to get your response.
    Regards,
    Anubha

  • Convert Char to Date in SQL Server

    Hello Experts,
    I am trying to convert Char to Date but getting error in Universe designer. Can anybody advise please?
    Thanks,
    Ravi

    Hi,
    Try with CAST() and CONVERT() functions. For more information refer use this url : http://msdn.microsoft.com/en-us/library/ms187928.aspx.
    It is more easy to get solution if you can post your query.
    Cheers,
    Suresh Babu Aluri.

  • Charger Buzzes when plugged into the Adapter Converter

    Im in England currently (From the USA) and am using a "DYNEX" converter adapter to switch the electric current down so I can plug in/charge my Macbook Pro and iPad.
    It works, however the charger buzzes pretty loudly and gets hot.
    Thankfully I brought two, one started smelling like melted plastic and stopped charging altogether. That particular charger has faulted at home before (back in the USA), so I'm not sure if it died because of the converter or because it's just faulty.
    I have plugged in the newer charger and it also buzzes, but I'm really worried to keep it plugged in because I don't want it to fault out too.
    Is it normal for it to buzz like that when plugged into a converter adapter?
    Thanks!

    The question again, why are you using a voltage converter?  The Apple charegers are all rated for 100-240 volts at 0-60 Hz...you only need a plug adapter to convert the US HEMA plug to the UK two round pin plug.
    Adding a voltage converter is adding one more failure point into the system.
    I have used mine all over Europe with no issues.

Maybe you are looking for