Search:

Type: Posts; User: jo15765

Page 1 of 2 1 2

Search: Search took 0.10 seconds.

  1. Replies
    17
    Views
    1,773

    [SOLVED] Re: Set Variable In Event Handler

    If I try to use the variable this like below


    Data this.data;


    I get errors of


    Error:(25, 9) java: not a statement
  2. Replies
    17
    Views
    1,773

    [SOLVED] Re: Set Variable In Event Handler

    I have my code as the below, where I declare the variable in my Data class, and from what I know, passing variable to the MouseEvent class. However, my JLabel prompt still shows empty?



    public...
  3. Replies
    17
    Views
    1,773

    [SOLVED] Re: Set Variable In Event Handler

    And I am assuming I will have to update how I call it? I am getting this compile error


    Error:(45, 41) java: constructor MyMouseHandler in class MyMouseHandler cannot be applied to given types;...
  4. Replies
    17
    Views
    1,773

    [SOLVED] Re: Set Variable In Event Handler

    I get a compile error of Duplicate Class: MyMouseHandler when I add this line in


    //Add Constructor
    class MyMouseHandler(Data data){
    dt = data;
    }
  5. Replies
    17
    Views
    1,773

    [SOLVED] Re: Set Variable In Event Handler

    Why do you recommend against setting the variable as static?
  6. Replies
    17
    Views
    1,773

    [SOLVED] Re: Set Variable In Event Handler

    I am new to JAVA - can you provide an example of this?
  7. Replies
    17
    Views
    1,773

    [SOLVED] Set Variable In Event Handler

    I have a class variable, that I want to set in a separate class. I am instantiating an instance of this class in my second class, and referencing and setting the variable. If I use a message box to...
  8. Replies
    4
    Views
    1,346

    [SOLVED] Re: Help With Flow-Layout

    After further testing, I am not sure why but adding in alignment for the label itself caused everything to display as I desired


    lblCenterChar2.setHorizontalAlignment(JLabel.CENTER);


    Can...
  9. Replies
    4
    Views
    1,346

    [SOLVED] Re: Help With Flow-Layout

    I thought that setting the max & min size of the labels with


    setMaximumSize
    setMinimumSize


    would combat this. If I change the width of my sub-panel the image still remains directly...
  10. Replies
    4
    Views
    1,346

    [SOLVED] Help With Flow-Layout

    Hi! I am going thro the flow layout tutorials and am attempting to set-up a panel with 3 labels that are left center and right in the panel. My code is so super close, I am sure it is something...
  11. Replies
    4
    Views
    2,812

    [SOLVED] Re: Position TextBox Under Label In Panel

    @Jim829 - I greatly appreciate this!! I like your approach of creating a method to createPanel - and your syntax properly aligns the label above the textbox. I had spent a great deal of time...
  12. Replies
    4
    Views
    2,812

    [SOLVED] Re: Position TextBox Under Label In Panel

    Updated OP to include imports and class information.
  13. Replies
    4
    Views
    2,812

    [SOLVED] Position TextBox Under Label In Panel

    Hi - I am attempting to dump the GUI editor and code everything by hand :) - big task for me! I am setting up my JForm with 4 panels, 3 to hold my data and a 4th as a "parent" that will house...
  14. Replies
    4
    Views
    1,374

    Re: Add Panels To JFrame

    Yes, I am using Netbeans GUI to write this code. - I just did a straight copy/paste of the class to ensure I did not omit any relevant code that could be causing my issue.

    --- Update ---



    So...
  15. Replies
    4
    Views
    1,374

    Add Panels To JFrame

    Hello - I have a main jframe that I am using to launch a secondary jframe - now my secondary jframe launches as I would expect and shows the header info, however the left panel (or the right panel...
  16. Replies
    3
    Views
    1,660

    Re: Create a JText field upon button click

    I have been trying to use JTextField, but set editable to false and here is the line I run:


    JLabel areaLabel = new JLabel("Answer Equals: ");
    JTextField areaField = new JTextField(5);...
  17. Replies
    3
    Views
    1,660

    Create a JText field upon button click

    I have 2 JText fields where I put in a 1st number in textfield1 and a 2nd number in textfield 2. I then have a button for "Total" What I want to do is when the Total button is pressed, create a 3rd...
  18. Replies
    12
    Views
    1,572

    Re: Help Passing Variables

    Cool :) I'll make a note of this, and use it in future coding projects!
  19. Replies
    12
    Views
    1,572

    Re: Help Passing Variables

    How would I use that?
  20. Replies
    12
    Views
    1,572

    Re: Help Passing Variables

    I was comparing the wrong 2 variables. Beginner's error. Thank you for the help! (As well as the future tip of printing the variables when results are not looking like I think they should)
  21. Replies
    12
    Views
    1,572

    Re: Help Passing Variables

    When I print the value of the variables, they display properly (as they should). That's why I was curious if I wrote my If statement wrong.
  22. Replies
    12
    Views
    1,572

    Re: Help Passing Variables

    Such a simple solution! I don't know why I didn't think of that! One more question...I think I have my if...else statement set up improperly. What it is supposed to do is if masterNumber equals...
  23. Replies
    12
    Views
    1,572

    Help Passing Variables

    I am running this code below:


    public static void Check(int masterNumber)
    {
    int reverseIt = 0;

    for (int i=0; i<=masterNumber; i++)
    {
    int r = masterNumber%10;
  24. Replies
    5
    Views
    1,961

    Re: Find Biggest Number in Array

    Ah, that makes sense. I was barking up the wrong tree thinking the error was due to trying to pull an int from a string array. Let me work on the coding a little bit and declare my statements a...
  25. Replies
    5
    Views
    1,961

    Re: Find Biggest Number in Array

    No it does not compile. When I try to compile that code, I get an error of:
    error: cannot return a vlue from a method whose result type is void


    To answer your questions:
    --My plan of attack...
Results 1 to 25 of 36
Page 1 of 2 1 2