Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Information Search! help!!

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Location
    England
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Information Search! help!!

    I have a very long break in front of me and during this break I want to see how far I can get to learning how to build a Google Keep style application. I want it to be a very simple window which has an option to add information (which will then be visually stored within the window), and I also want a search bar which can bring up results of any information stored by the user within the application.

    obviously just saying it like this is simple but can anyone boost me off? offer me a guideline or a basic understanding of what needs to be done?

    Thanks for any replies.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,039
    My Mood
    Mellow
    Thanks
    184
    Thanked 647 Times in 634 Posts

    Default Re: Information Search! help!!

    What do you need help with? How much Swing experience do you have? How much Java experience do you have?

    What you describe is a JFrame with 2 or 3 components, some file I/O, a couple action listeners, and some search logic. If that is all foreign to you, you need more than a boost. I suggest you start with the Java Swing Tutorials, ignore the Netbeans stuff, and in a few days or weeks should be able to have the basic design put together.

    Or, if you're near the bleeding edge of Java technology and want to stay there, find the JavaFX tutorials and program your ap in JavaFX.

  3. The Following User Says Thank You to GregBrannon For This Useful Post:

    fazraz (August 5th, 2013)

  4. #3
    Junior Member
    Join Date
    Jul 2013
    Location
    England
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Information Search! help!!

    I don't have THAT much experience. I know about JFrames and design elements such as buttons etc.., I know about action listeners (although I dont entirely know how to use them). I'll have a look at the link you provided and see where that gets me! Thanks a lot.

    --- Update ---

    Okay, I have made the JFrame, I have a textfield, a textarea and a button named "Add to diary".

    So far, I can type something into the textfield, press the "Add to diary" button, and the text appears in the textarea.

    but if I type something and press the button, then type something else and press the button, the first bit of text gets replaced. how can I just make the new text appear underneath on a new line?

    thankyou for your help!

  5. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,039
    My Mood
    Mellow
    Thanks
    184
    Thanked 647 Times in 634 Posts

    Default Re: Information Search! help!!

    Wow! Great progress.

    As for your question, you need to use a component that allows text to be appended to that already existing in or contained by the component. A JTextArea has that ability while a JTextField does not. I suggest you do a quick read-through of the API page for each new component you use. This will give you an idea of what each component is able to do. You don't need to memorize the pages, but you'll remember them well enough so that when you're faced with a new problem or design consideration, you'll remember roughly where to look for ideas and then the specifics.

  6. #5
    Junior Member
    Join Date
    Jul 2013
    Location
    England
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Information Search! help!!

    Thanks a lot! I'll have a read but it is the TextArea where the text is appearing, I am typing the text in the TextField. I want it to appear on separate lines within the textAREA. Know what I mean?

    Thanks for being so helpful!

  7. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,039
    My Mood
    Mellow
    Thanks
    184
    Thanked 647 Times in 634 Posts

    Default Re: Information Search! help!!

    Absolutely! Sorry I didn't say it well, suggesting you weren't using the right components, because you are. The code to do what you want will look like:

    jTextArea.append( jTextField.getText() );

    Then I imagine you'd clear the JTextField to wait for the next input.

  8. #7
    Junior Member
    Join Date
    Jul 2013
    Location
    England
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Information Search! help!!

    Yeah that's exactly right!

    So, I have this:

    private void AddNoteActionPerformed(java.awt.event.ActionEvent evt) {

    String MESSAGE = TypeNote.getText();

    ATD.setText(MESSAGE);



    Then there are two expressions floating around...

    One is : ATD.append(MESSAGE + newline);

    and the other is: private final static String newline = "\n";




    I know somehow I need to use them somewhere, but I am having a mind blank from here and cant figure it out!

Similar Threads

  1. Replies: 0
    Last Post: February 1st, 2013, 11:25 AM
  2. [SOLVED] Getting information from a other class
    By lf2killer in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 26th, 2012, 09:19 AM
  3. Get information from browser
    By Yoyo_Guru in forum Java Networking
    Replies: 1
    Last Post: July 20th, 2012, 01:54 PM
  4. Graph Search Theory with extend of BFS, UFS and A* Search in grid
    By keat84 in forum Java Theory & Questions
    Replies: 1
    Last Post: February 7th, 2012, 08:46 AM
  5. can't get all the information out of my array at once... please help
    By Tate in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 28th, 2010, 05:22 AM

Tags for this Thread