Search:

Type: Posts; User: SunshineInABag

Page 1 of 2 1 2

Search: Search took 2.65 seconds.

  1. Replies
    9
    Views
    229

    Re: Calling up array methods from main

    No offence but, how is it you can write your own methods, use static, return statements and single-dimension arrays, yet don't know how to call them? Use whatever source(s) you're studying or...
  2. Re: Need help inputting and writing to a external data file.

    Since it is not entering the if-statement of if(!inputFile.exists()), the representation of the file or the file itself exists. It's now a matter of figuring out what the compiler thinks the file...
  3. Replies
    2
    Views
    98

    Re: && , || usage?

    This if-statement will return true if a + c > b is false OR b is divisible by 3 without a remainder. The only time it will not return true is if a + c > b is true and b is not divisible by 3.


    ...
  4. Replies
    10
    Views
    192

    Re: button overlapping the other button

    Most layout managers try to ensure each JComponent is side-by-side or some other arrangement other than overlapping. However, there are a few that rely on overlapping, such as CardLayout (not sure if...
  5. Re: Need help adding Displays to a program

    What have you tried to code each of the 4 additional features of a help option, setParams option, FillArray option and DisplayResults option? I'll give a very rough outline of the logic and you may...
  6. Replies
    9
    Views
    229

    Re: Calling up array methods from main

    Since all the methods are static, you just need to call them without creating an instance of the class and make sure you assign a variable that is of the same data type as the return (for your...
  7. Replies
    10
    Views
    192

    Re: button overlapping the other button

    I'm a bit confused, are you trying to get the buttons to have that overall appearance but function as 1 button OR are you trying to get 2 buttons with different functions/roles overlap each other?
    ...
  8. Replies
    6
    Views
    132

    Re: swing layout problems

    Can you post the code so we can see what happens or make a SSCCE? It could possibly be the layout that you have chosen. If you want to have more control over the layout, try GridBagLayout.
  9. Re: Searching with keywords in a sentence

    Your if-statement is insanely large and impractical, especially if you want to compare more words. Instead, use another array or an arraylist, such as:



    public class TestSentence {
    public...
  10. Replies
    1
    Views
    123

    Multidimensional array uses

    Multidimensional arrays can have any number of dimensions to them, from int[][] to int[][][][]. I understand how a multidimensional array with 2, 3 and 4 dimensions can be used practically but what...
  11. Replies
    6
    Views
    226

    Re: First assignment java program

    Open a fully functional java program and use it as a checklist to see what the code needs to be functional. So far, you've identified there has to be a ; at the end, a class and a method (either a...
  12. Re: How to open new windows after pressing button next?

    Can you post the contents of the .rar because many people (myself included) will not open a .rar for security reasons. You can use only the 1 JFrame you have and place the contents of the other...
  13. Re: How to print information from an array

    It may not be causing a problem right now but have you tried using hasNext() instead of hasNextLine() as the latter may return true even if there is nothing in the next line.

    As for your actual...
  14. Replies
    6
    Views
    163

    Re: PROBLEMS WITH LOGIN FORM

    There are a few ways to achieve what you want but without seeing the entire code, it's impossible to know why your program is behaving the way it is. One way is to use 1 JFrame and use a Layout...
  15. Replies
    1
    Views
    71

    Re: find a password

    Try replacing the == with equals(searchKey), that should fix the problem. If you don't care whether letters are upper or lower case, you can instead use equalsIgnoreCase(searchKey).
  16. Re: Cannot find symbol - method getItemNumber()

    Your Supplier class does not have the method getItemNumber().
  17. Re: Newbie Question...GUI Text input Areas

    Easiest way that you can do in 1 chained line or a few lines is to first keep jtf.Message.getText() as that retrieves and represents the value as a String object. To get that into a primitive int,...
  18. Replies
    3
    Views
    167

    Re: Noob to Java

    There are many on YouTube, such as:

    Brandonio Productions - YouTube
    thenewboston - YouTube

    In terms of compilers, there are numerous different ones and any one should suffice your needs. The...
  19. Re: Components not appearing (need help!)

    When I write GUI code, I follow a specific layout of how I arrange my code. There are different ways of placing the event-listener code in the GUI, so feel free to use a different way if you wish....
  20. Re: Writing code to save in a file... help please

    If you already submitted your assignment, it's too late to add this but for future reference, your main method contains "throws IOException" but no where in the method do you use either a...
  21. Replies
    3
    Views
    233

    Re: How to add a title

    You already have a title called Login that you set using the JFrame method, setTitle("Login"). Do you want a JLabel to be in the top left corner but underneath the bar where the title is shown? If...
  22. Re: Random access IO and printing to a laser printer

    You can use the RandomAccessFile class found in the java.io. package. Here is a link containing the syntax and its methods. You may also want to look at the File class, which is treated as a...
  23. Replies
    4
    Views
    200

    Re: JButton by pressing the enter key.

    You may want to re-organize your code to set it up for creating a listener, capturing the event and registering the listener to the appropriate JComponents. There are a few ways to do this, such as...
  24. Re: I dont know what to call this tittle.

    If I'm correctly understanding your question, then you can use:

    int index = (int)(Math.random() * 5);

    Normally, Math.random() will select random numbers from 0 to as close to 1 as possible...
  25. Replies
    2
    Views
    178

    Re: Complete java

    When I first started learning Java, which wasn't all that long ago, I watched YouTube videos from thenewboston and BrandonioProductions. They have videos starting from the basics, such as downloading...
Results 1 to 25 of 49
Page 1 of 2 1 2