Search:

Type: Posts; User: scorpas

Page 1 of 2 1 2

Search: Search took 0.23 seconds.

  1. Re: KeyListener - how to make program react to the key that was pressed twice?

    no presses - first ball moves.
    one press - first ball stops, second ball starts to move.
    two presses - second ball stops (both are not moving).

    Then some small action happens in the game and the...
  2. KeyListener - how to make program react to the key that was pressed twice?

    So, shortly...

    My mini game:
    When I press a 'Space bar' key - the first ball (A) stops moving, and the second ball (B) starts moving.
    The problem: How to make the second ball (B) stop moving...
  3. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    actually, i rewrote my JFrame class.
    delete those instance of JFrame class in other classes.
    when i call setText() method by just writing:...
  4. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    i don't get it... sorry, my english skills are poor, specially about programming things :D
  5. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    what do you mean?
    i can see that textbox, when i run my project.
    and as i said, if I use setText() method in the same (baaaa) class, i can see the value of the textbox.


    one instance of a frame...
  6. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    how it can be invisible if it is declared:

    public JTextField textField;

    and it is set:

    textField.setVisible(true);
  7. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    aa: Zaidimas.baaaa@b162d5
    aa.textField:...
  8. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    When i run my project and select Main class as a main, only applet starts (no GUI): Example

    ok i modify that Window class, now it looks like that:

    public class baaaa {

    public JFrame frame;...
  9. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    actually, i create this, by using windows builder in eclipse :D so most of the source code, was auto-generated by Eclipse. i just picked an element (for example JTextBox), draged it on that window,...
  10. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    ok, so i modify my Window class to minimum: no buttons, no menus, only that textfield and applet starts when Play button is clicked...

    this is how it looks:

    public class Window extends JFrame {...
  11. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    it's two times.
    but my project works like that:
    - firstly, the small window shows up with the button "play".
    - after that buttont is clicked, the same window becames bigger (resize method) and an...
  12. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    don't get it...
    do you mean i call Window class twice w/ the same name (win)?
  13. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    where i should call repaint()?
    tried to put it, just after win.textField.setText(Integer.toString(app.score)); line:

    win.textField.repaint();

    Still, text field empty.


    If i use...
  14. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    ok, i manage to fix that error, it was my bad in text field declaration.

    now in my Window class, that extends JFrame, i have:


    public JTextField textField;
    private void initialize() {...
  15. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    it is textfield...


    win:...
  16. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    That's right.

    so i declare in a ball class:

    Window win = new Window();
    Main app = new Main();
    and tried to write this, right after that if:
    ...
  17. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    method in a ball class.

    public void CheckCollision(Block b){
    Rectangle2D.Double ball = new Rectangle2D.Double(x-radius, y-radius, radius*2, radius*2);
    Rectangle2D.Double block = new...
  18. Replies
    34
    Views
    9,337

    [SOLVED] Re: how to put changeable value in JTextField?

    I do understand that.
    But i can't imagine how to do that :D
    So, i have Main class, in which 'score' value is updating, every time the ball hits a block (brick).

    And i do have a class for a GUI...
  19. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    ok, done, this one is SOLVED.
    Big thanks to Norm. :)
  20. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    if i understand what u asking, then:
    i have array list of blocks (bricks).
    when an applet is running blocks are destroying by a ball collision. So yes, list are changing while the game is playing....
  21. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    i understand that, but can't figure out, how to load images only once.

    i do load same image for all blocks. and sometimes when the ball hits a block, errors appears:

    Exception in thread...
  22. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    sleep change the speed of an applet, but lag still remains.
    i guess it is something with repaint() method.
  23. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    Yeah. Finally, u are genius, man!!! \m/
    THANK YOU!

    It works, but its very laggy :D
    any ideas how to fix lag? :(
  24. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    an app for a PC (my task is to create something who works on Linux). Runnable from .jar file after double clicks on it.

    as I said, my images are in 'this_project/src/images' folder.
  25. [SOLVED] Re: Images works on an applet, but doesn't work when an applet is in a JFrame.

    display existing ones.

    the problem is, that i don't understand ur suggestion.

    my applet is in Main class...

    i tried to create in the Main class getCodeBase() and getDocumentBase() methods. ...
Results 1 to 25 of 34
Page 1 of 2 1 2