Need Help Desparately For Project

Hello Everyone,
My problem is that I have a JFrame with a two JPanels inside of it. Inside one of the JPanels I have a JTextArea and the other a JTextField. In the class constructor I create this objects and using show() display them. I want the content typed into the JTextField appended to the JTextArea. Unfurtunately although the information is retrieved from the user and appended to the JTextArea it doesn't show up on the JTextArea even after I've made a call to repaint(). Is this happening because the appends must occur in the main method? Currently I have the main method call printToJTextArea() to read the info in the JtextField and append it to theJTextArea. PLEEEEAAAASSSSE HELP!!!!!!!!!!

//I made some changes but is still isn't working
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AddMagician implements ActionListener
     JPanel panelAddMagician = new JPanel();
     JPanel panelShowMagicians = new JPanel();
     JFrame Console = new JFrame("Magician Console");
     JTextField txtaddMgcn = new JTextField(25);
     JTextArea txtaShowMagician = new JTextArea(20,30);
     BinaryMagic use = new BinaryMagic();
     AddMagician()
          panelAddMagician.setSize(400,50);
          panelShowMagicians.setSize(400,50);
          Console.setSize(450,450);
          Console.getContentPane().setLayout(new BorderLayout());
          txtaddMgcn.addActionListener(this);
          panelAddMagician.add(txtaddMgcn);
          panelShowMagicians.add(txtaShowMagician);
          Console.getContentPane().add(panelAddMagician, BorderLayout.NORTH);
          Console.getContentPane().add(panelShowMagicians, BorderLayout.SOUTH);
          Console.show();
          Console.addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    System.exit(0);
     public void Create()
          panelAddMagician.add(txtaddMgcn);
          panelShowMagicians.add(txtaShowMagician);
          Console.getContentPane().add(panelAddMagician, BorderLayout.NORTH);
          Console.getContentPane().add(panelShowMagicians, BorderLayout.SOUTH);
          Console.show();
          txtaShowMagician.append("A List of Current Magicians:");
          Console.addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    System.exit(0);
     public void listMagicians(String name)
//          System.out.println(name);
          txtaShowMagician.setText("A List of Current Magicians:");
          txtaShowMagician.append(name);
          System.out.println("shit: " + txtaShowMagician.getText());
     //     panelShowMagicians.repaint();
          Console.getContentPane().repaint();          
     public void actionPerformed(ActionEvent e)
     //     System.out.println(e);
          if (e.getSource() == txtaddMgcn)
               use.newMagician(txtaddMgcn.getText());
               use.printMagician();
     public static void main(String [] args)
          AddMagician add = new AddMagician();
     //     add.Create();
          add.txtaShowMagician.append("here");
class MagicianNode
     Comparable name;
     Comparable holiday;
     MagicianNode left;
     MagicianNode right;
     AddMagician sendGUI = new AddMagician();
     public MagicianNode (Comparable n)
          name = n;
          holiday = null;
          left = null;
          right = null;
     public void print()
          String temp = ("\n" + (String)name + "\n");
//          System.out.print("\n" + name + "\n");
          sendGUI.listMagicians(temp);
class BinaryMagic
     MagicianNode root;
     public BinaryMagic()
          root = null;
     public void newMagician(Comparable n)
          if(root == null)
          root = new MagicianNode(n);
          if (n.compareTo(root.name) < 0)
               if (root.left == null)
                    root.left = new MagicianNode(n);
               else
                    newMagician(root.left, n);
          if (n.compareTo(root.name) > 0)
               if (root.right == null)
               root.right = new MagicianNode(n);
               else
                    newMagician(root.right, n);
     private void newMagician(MagicianNode node, Comparable n)
          if (n.compareTo(node.name) < 0)
               if(node.left == null)
                    node.left = new MagicianNode(n);
               newMagician(node.left, n);
          if (n.compareTo(node.name) > 0)
               if(node.right == null)
                    node.right = new MagicianNode(n);
               newMagician(node.right, n);
     public MagicianNode findMagician(Comparable x)
          if (root == null)
               return null;
          return null;
     public void deleteMagician(Comparable x)
     public int countMagicians()
          if (root == null)
               return 0;
          else
               return magicianCount(root);
     private int magicianCount(MagicianNode node)
          if (node == null)
               return 0;
          else
               return (1+ magicianCount(node.left) + magicianCount(node.right));
     public void printMagician()
          if (root == null)
               return;
          else printMagician(root);
     private void printMagician(MagicianNode node)
          if (node.left != null)
               printMagician(node.left);
          node.print(); // this print() method is a reference to the Treenode print() method.
          if (node.right != null)
               printMagician(node.right);
}

Similar Messages

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Need help with a project

    Hi,
    I'm a final year engineering student doing my project on cloud computing. Our project is a web application developed which concerns the issue of cloud security.Our lecturers asked us to put it on the cloud instead of showing it as a web application. So we
    are trying the trial version of Windows Azure. I need help in putting my project on to the cloud. Please help regarding this as soon as possible... 
    We are using Apache tomcat, JDK 1.6, Wamp server for our web application and we have developed this using netbeans IDE
    Very Urgent!!!

    Hello there, if you're still looking for help you might not be in the right forum.  This fourm is all about Azure SQL Database.

  • I need help In my project

    Hi
    Iam computer engineering student, Iam working on design course
    The idea of my project is to use both speech to text and text to speech code to help deaf people to communicate with others using a telephone.
    Can u tell me if I can use java code for "voice recognition" and java code for text to speech in my project?
    I my idea impossible or can i work on it please tell me I need help.
    thanx alot

    heloo sir..
    i have a small doubt in setting the size of the panel...i.e...code as follows..
    public class ImageRegion extends JPanel
    out side the class i creted the object of that class i.e..
    imageRegion = new ImageRegion( ) ;
    and an image(has specified size) is dispalayed inside the object panel ..
    so im not able to set the size of the object Panel..i used setSize() and setPreferedSize() methods but im getting the height and width as zero if i try to print the size by using the getHeight() and getWidth() methods..
    please help me..and replay to this mail as early as possible..
    Regards..
    VIVEK
    --------------------------------------------------------------------------------

  • Hello i need help looking for fire fox 64 bit i have 32 bit it really slowing down my laptop

    hello I was told there was a 64 bit that I can use for fire fox iam using windows 8.1 but I can only find fire fox 32 bit I need help to get 64 bit plz and thx

    locking this question as duplicate, please continue at https://support.mozilla.org/en-US/questions/1047357

  • I need help with exporting project for the web

    Probably something i am doing wron g but here are the problems. When I use Quicktime Converter, if I try to convert to a Quicktime movie or an MPEG-4 nothing happens and i get a 'File error;File Unknown message' when i try to convert to an AVI File, it works, but even though I have already rendered the project, it shows up with little flashes of blue that say 'unrendered'. and finally, when I try to make it a w
    Windows Media File, it stops after 29 seconds. Any ideas?
    I have an iMac with dual core processor, and FCE HD 3.5.1. I have my video files on an external drive.
    iMac   Mac OS X (10.4.10)  

    perform a search using the term export for web and it should throw up some ideas.
    here's one for starters:
    http://discussions.apple.com/thread.jspa?messageID=2309121&#2309121
    If you're using flip4mac to convert to wmv, the trial stops at 30 seconds - you need at least wmvstudio to export to wmv:
    http://www.flip4mac.com/wmv.htm

  • Need help importing a project

    I got a virus on my mac so i took all stuff off my computer and put it on an external hard drive including an imovie project. I wiped my computer and imported all of my stuff including this imovie project. I downloaded Yosemite and the new imovie software and now when i try to import this imovie project it doesnt work and will not import it says its not compatible. This imovie project says its format is an imovie project, i just need to import it into imovie again so i can work on it, thanks.

    Hello there, if you're still looking for help you might not be in the right forum.  This fourm is all about Azure SQL Database.

  • Help me for project!!

    Work in a electrica company, has a "escada system", I am gliding to propose a project that uses labview, to improve the monitoreo of these systems, that equipment to use, and to pass information to me about this subject.

    Apart from not having any question in the post, I have a problem finding out what it is you want. It`s impossible for anyone to give a helpful response to a question incorporating so little information about the problem.
    SCADA is a term used for general software control and data acquisition. As such, the term scada does not provide any useful information.
    I assume that English is not your first language, and that some of the nuances of your problem are being lost in translation. Try posting in your own language. Although most people prefer questions in English, if it can be better understood in your own language, this is the better option.
    If you get the impression I`m criticising your English, I`m sorry. This is not my intent. I just think you need
    to post this question again with more information so that someone can help.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • NEED HELP ASAP for editing voiceover!

    I'm working on an anniversary dvd and have recorded several voiceovers to be combined with photos. However, there are parts of the voiceovers that I need taken out. Is there a way to copy and paste a voice over so I can trim it and use certain parts from it? Aaaccckk! Help would be appreciated as time is of the essence with this project. I have a ton of experience with iMovie, but since the recent upgrade this voiceover feature is new to me. Thank you!

    Welcome to Apple Support Communities.
    Bear with me. I'm making some assumptions here:
    Apparently your MacBook 3,1 was still running OS X 10.5 "Leopard", so FIRST, you needed to purchase and install OS X "Snow Leopard" from disc.
    The Snow Leopard retail disc contains and installs version OS X 10.6.3. 
    Next (?), you ran , Software Update, or downloaded an OS X 10.6 Combo Update in order to get to at least version 10.6.6, the first version that supports the Mac App store.
    Once you have OS X 10.6.6 or higher installed, you have the Mac App Store installed,and IT is required to purchase, download, and install OS X 10.7 "Lion", NOT OS X 10.8 "Mountain Lion". Your system is NOT and cannot be made capable of running OS X 10.8.
    The minimum requirements to purchase, download and install OS X 10.7 "Lion" are:
    http://support.apple.com/kb/SP629
    1) OS X 10.6.6 or higher,"Snow Leopard" installed
    2) At least 2GB RAM installed
    3) At least 7GB hard disk space available (though in my opinion, you still need at least 10GB more free hard disk space for adequate system performance, so figure on needing at least 17GB free just for OS X Lion)
    Once that is done, you still need additional sufficient additional hard disk space to purchase, download and install Adobe Photoshop Lightroom5.
    http://www.adobe.com/products/photoshop-lightroom/tech-specs.html
    And, although 2GB is the minimum required RAM for both OS X 10.7 and Lightroom5, 4GB RAM would provide better performance, though your system will not be a speed demon, regardless.
    Message was edited by: kostby

  • Need help with MS Project

    Hi All,
    My PM has asked me to prepare a project plan but I am quite new to MS project (in fact this is the first time I am creating a complete project plan) and any project management software as such.
    My requirements is that I have three different entities (A, B, C) responsible for the tasks in the project. I have created separate custom fields for each and entered their name against the tasks. Now, I need to include % of work completed for each of them
    separately so that each task can be independently tracked against the entity responsible. Some of them are combined tasks where in A & B are to complete those and some are individual.
    For example, Task 1: A - 50%, B - 30%, C - 60% 
    Task 2: B - 75% etc.
    So I added % of Work Completed against each entity (in adjacent columns), but when I update one it gets reflected in the other columns as well.
    Is this the right way to do it? Is there any other way to do it? Plz help.
    Regards,
    Ahmed

    Hi Ahmed,
    If I understand your question correctly, I think you can use Task Usage view to manage individual/entity % work completed against a particular task.
    I have tried to put together an example:
    I have assigned the entities (resources) against each task
    and then used the Task Usage where I've inserted the %work completed to track entities (resources) against each task
    There are also other options/views that can be used, like Resource Usage
    Hope this helps
    Paul

  • Need Help Urgently For Displaying RESULTS PER PAGE

    i am comiling a serch engine throgh JSDK servlets and using a personal Oracle database. i currently have over 2000 records and when they are returned they are all being returned in one big table. i am trying to get the servlet to display so many results per page, for example 30 per page. I am at a loss on how to do this and have tried a number of methods, i urgently need to find a way of doing this as it is for a Major school project. I hope someone can help me i would be extremly greatful if someone could. Please
    Thanks

    Hello --
    One way to do this would be something like this:
    1. Start out with a page where filtering parameters could be entered, submit to the servlet with a starting position of 0.
    2. Grab all the rows from the oracle database, toss them in an array.
    3. Draw items in a table from the starting position to the number of entries per page from the array.
    4. Put a Previous and Next button on the results page to submit back to the servlet in step 2 where the starting position is the current position - number of results per page for previous, next is the has a starting position of current position + number of results per page. You'll want to do range checking, etc on this.
    The key trick is to ask one servlet to do steps 2-4. I've used hidden variables on the form with some javascript to set the new starting parameter for previous and next. You could assemble a URL in javascript also.
    There are probably slicker ways to do this, but for 2000 rows, it should probably work well enough.
    Good luck.
    Donn

  • How to get XI projects requirements? What and i need to ask for Project ?

    Hi Experts
        I know XI for some extend but i don't know any thing about requirements
        Next week i have meeting with client so what and all things i need to ask ?
        Pls...guide me on this
    It will be really helpful to me.....
    adv thanks and points to all
    Regards
    Kiran LVS

    Hi Kiran
       In addition to the above link  are the things you can ask the client to get the requirements
    1) What is the problem? This will give answer for why they are going for XI? Here try to 
        Understand the business as well as integration? Where XI come into the picture?
    2) Total number of systems involved in integration? That is their SLD? Details?
    3) Scenario’s (interfaces)? Total? What kind of? But here once again this is depends on project
        Some times client will give this (or) based on the requirement you people have to decide?
        It is fully depends …..!!!!  take care
    4) Then based on the scenario you need to get the full information ....this is
        place where you can ask all the questions …from scenario to scenario ….get all the details as
        mentioned below
    apart from the basics try to ask some thing technically
    5)  Are they providing any XSD,WSDL, documents, Naming conventions..etc
    6) Protocals related like http, ftp, smtp, soap....
    7) If file related then CSV, Fixed....like that delimiter specific details ….very imp this one
    8) If R/3 present then ....it is Idoc, Rfc, BAPI,....any proxies and webservices for
       direct communication ....etc
    these are the basic things for XI integration project and after that every thing is specific to
    scenario’s
    Same time check in the SDN with key word “XI Requirements “
    I hope this will help you to face the client but before that try to understand the client business and systems…..!!!!(Imp)
    Regards
    Prasad K

  • I need help with my project [Navigator application acesible thru the phone]

    I am currently working on my project proposal for the project i want to do. I need to develop a navigator appliation that is accesible thru a phone and hsa the following features:
    1. Load image in display buffer and deending on wat user inputs, then i can manipulate the image and draw stuff on it like if the user requires the shortest route, then it can be drawn...
    2. Provide traffic updates from rss feeds [online]- in this case i need to know how to use the http request class in J2ME wireless toolkit.
    3. Incorporate GPS System or if any other otpion is there for me to be able to tell the location of a user dynamically and use that info to map the location on the map image in the display buffer
    4. Provide info about places using pop ups depending on what the user inputs
    5 general advice on MIDP development esp that its different from wat am used to [desktop programming]...
    The biggest challenge is that am new to mobile apps esp MIDP,Am a student in my final year, and the proosal is this coming week and ineed some help [or should i say breakthrough] SOMEBODY HELP ME..!!

    Sup mismis ,
    Its a shame to say this but am so new to this i would bore you to death coz i have little (if any soultions)...but i believe if we work together we can go far...
    The gps part was quite as process because either way, i had to go thru a 3rd party to get the service, so wat i said i will do is simulate a gpsi.e have a sub component on the side that simultes a gps (as i believe it return the latiotude and longitude positions of wea u are) then using this info i can trace on which region of the map you fall in depending on what mesh u fall in, is that simple or wat?
    The othe rthing is that am using J2ME which am not familiar alot wih. Ive used netbeans but for desktop applications not mobile....
    But i also have a question, since the whole app would be better on the mobile fully, how do u include the dbase?

  • Need Help Deploying Creator Project with Derby as Embedded

    HI,
    I have developed a web app using creator and the derby database instance that runs within creator. Now I want to war up the app and include the derby db as an embedded database. I have included the derby jar file in my lib directory and have created a new datasource with the derby embedded driver for testing. I cannot seem to get the db to run as embedded. My data source is setup as follows:
    dataSource name="DerbyTest3"
    driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    url="jdbc:derby:../sample"
    validationQuery="select * from "
    username="dbadmin"
    password="7237EACC50DB74EF"
    />
    The sample database was copied from the creator source tree and inserted under WEB-INF
    When I try to connect I get the following error:
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: org.apache.jasper.JasperException
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Database '../sample' not found.
    Possible Source of Error:
    Class Name: org.apache.jasper.servlet.JspServletWrapper
    File Name: JspServletWrapper.java
    Method Name: service
    Line Number: 384
    any help greatly appreciated.
    gary
    Message was edited by:
    garff
    Message was edited by:
    garff

    One of our developers mentioned this, but it's also in the derby ref manual for the SQLException you're getting:
    http://db.apache.org/derby/docs/10.2/ref/rrefattrib26867.html
    sounds like you needed to append
    ;create=true
    to the JDBC Url...
    HTH,
    skj

  • Need help on this project

    The contestants will demo their application/web site on a machine with 128 Meg RAM only.
    You will build an application/web site that helps Hollywood movie fans do research on the data available at the Internet Movie Database. Two kinds of users can access your application, movie fans and the database administrator. The movie fans basically lookup the data, while the administrator also has the capability to add, update, and change data. You will use your imagination to define the functionality of this application/web site given the kind of data that is available at Internet Movie Database.
    Minimum Requirements:
    At a minimum your program should prompt for the name of a Hollywood movie star. For each movie star it will list the actor or actress who has been in the most movies with the movie star. If there is a tie, all persons in the tie are listed. For each actor in the listing shared movies are to be listed. For example, if the input actor is "Hanks, Tom", the output would look something like:
    Reiner, Tracy (5 shared roles):
    Apollo 13 (1995)
    Big (1988)
    League of Their Own, A (1992)
    Nothing in Common (1986)
    That Thing You Do! (1996)
    For "Roberts, Julia" there is a tie, so output would look something like
    D'Onofrio, Vincent (3 shared roles):
    Dying Young (1991)
    Mystic Pizza (1988)
    Player, The (1992)
    Roberts, Lisa (I) (3 shared roles):
    I Love Trouble (1994)
    Runaway Bride (1999)
    Something to Talk About (1995)
    Test your program on the following actors:
    Abbott, Bud
    Cher
    Cruise, Tom
    Diaz, Cameron
    Doe, Jane
    Leno, Jay
    Lopez, Jennifer
    Parker, Sarah Jessica
    Presley, Elvis
    Shatner, William
    The Input Files for the minimum requirements:
    There are two data files; both have identical formats. These files are: actors file (actors.list.gz) and actresses file (actresses.list.gz). These files are both compressed in .gz format, and are available from the Internet Movie Database. Combined, they are 45+ Mbytes (compressed!).
    These data files contain approximately 590,000 actors/actresses in a total of 171,000 movies, with 1,900,000 roles. These files also list TV roles, you must allow option to include or exclude TV roles in your analysis.
    What To Submit:
    Submit complete source code and demo your application on a machine with RAM of 128 Meg only. Also indicate how long your different algorithms take. Each submission will be judged on the basis of efficiency of the algorithms, the functionality of your application/web site, the usability and crispness of your user interface, the extra steps your application takes to avoid running out of memory, and the object-oriented design of your program.
    You are free to write a standalone GUI based program, or/and develop a Web Site, which allows global access to your application. You can use Servlets/JSP or ASP.NET for this purpose. However, you are not allowed to use any database software or utility container classes (Java or C#).
    You may not uncompress the data files that you obtained from Internet Movie Database outside of your program or put them in a database provided by any vendor i.e. you cannot use databases provided by Oracle, Microsoft, etc. However, you are free to write your own data management code that reads from these files at the start of the application creates and writes back to them at the time of shut down of the application. You are also allowed to create temporary files during the execution of the program.

    /sigh
    If you are having problems with you project then post your problems but do not expect us to do your homework for you hehe.
    You should post a detailed description of what you are trying to do, the code that doesnt work, the error message that you are getting and what ever sysmtoms that your application is showing to you so that we ma have a good idea on how to help you ... with out having to do your work for you :p

Maybe you are looking for

  • Remote not working on dvr but works on other boxes

    I have a Dvr box in the back of the house, It was working fine today earlier. I went back in the room and poof the remote dosent work on the box. It still works the tv. So I took it out to the other boxes in the house and it works fine on the other b

  • Continuing issues with iMac i7

    I bought an iMac i7 27" just under a year ago. Within a month of ownership the cooling fans powered up to 100% and refused to switch off - it was like working next to a couple of hairdryers. (apple support said it was cooling like that because I was

  • How to test the PMS/apprisal template

    Hi experts, We have completed the configuration of Apprisal templete. With OOHAP_BASIC,PHAP_CATALOG_PA we have completed the process along with status and substatus,staus flow. I struckup at this juncture. How to test the entire process after the con

  • Barcode label printing - 2 copies required

    Hi, The barcode label for TO is printing automatically but the user requires 2 copies instead of one. We have assigned the Spool code for 2copies in the print table in config  (OMLV). But still only one copy is getting printed. Please advise. Regards

  • Basic monitoring question!

    this should be easy, i'm even embarassed to ask! i've only recorded on my own till now, just plugging my headphones in the back of the computer. but how can i record someone else, and be able to listen along and play engineer?