User Profile

Collapse

Profile Sidebar

Collapse
rpm27
rpm27
Last Activity: Mar 8 '23, 08:10 AM
Joined: Jan 7 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • rpm27
    started a topic How to initialize a static class variable
    in C

    How to initialize a static class variable

    Hey everyone,

    I am trying to declare a static class variable (not a 'primitive' variable, but from a class i wrote) inside a class

    However, I have tried several ways to initialize it and they all caused compilation errors:

    Code:
    #include "MyClass.cpp"
    
    class A
    {
    static MyClass* m = new MyClass();
    
    public void example()
    {
    m->doSomething();
    }
    ...
    See more | Go to post

  • rpm27
    started a topic new MySQL account

    new MySQL account

    Hey everyone,
    sorry for the newbie question, but after some problems with configuring mySQL, I was able to create a new user account. My question is, how can I remove the password from the root account? and what should I have done during the installation in order to access the root account without a password. Thank you.
    See more | Go to post

  • rpm27
    started a topic Eclipse problem
    in Java

    Eclipse problem

    Hi, I am using Eclipse as an IDE, however as I repeatedly run and test my code, my PC begins to slow down, my CPU usage reaches a constant 100%, and it becomes an impossible task to use Eclipse (even when I stop running and edit the code, the PC blocks). Does someone had this same problem? I usually assume that my code stops running and resources are released when the result is displayed in the console, or when I run into an error. Should I stop...
    See more | Go to post

  • rpm27
    replied to Creating a new JComponent
    in Java
    This thread seems to get annoying :-) Anyways I don't actually have time to test these solutions. When I'll try them, I'll post more questions . Thanks again...
    See more | Go to post

    Leave a comment:


  • rpm27
    replied to Creating a new JComponent
    in Java
    But, what if it's not a circle? Maybe some irregular shape, or a silhouette? I know I'm testing you patience :-) but I'd like to put my question in another way. I'd like to create a new button, with a look and appearance that I specify. Anyways, I'll try to extend class JComponent, and use paintComponent( Graphic g) to specify how it looks like. Thank you....
    See more | Go to post

    Leave a comment:


  • rpm27
    replied to Creating a new JComponent
    in Java
    I understood that (I've already written something similar), but when I create an event handler class which implements MouseListener, and I write a method mouseEntered(), how the program will know that the mouse entered this particular circle so I can change its state to Active?...
    See more | Go to post

    Leave a comment:


  • rpm27
    replied to Creating a new JComponent
    in Java
    I didn't realize that my post wasn't clear enough. Here's what I had in mind.
    As a test before I stumbled upon this problem, I already created a class Circle with the following methods:
    Code:
     void setColor(Color c)
    void setSize(int x)
    void setPosition(int x, int y)
    void setActive(boolean b)
    void draw(Graphics g)
    My original idea was to create a class which extends JPanel, and have as instance...
    See more | Go to post

    Leave a comment:


  • rpm27
    replied to Import declaration
    in Java
    Yes, right after writing this post, I convinced myself that import individual classes would help me as I'm a Java beginner. Thanks anyway. :-)
    See more | Go to post

    Leave a comment:


  • rpm27
    started a topic Creating a new JComponent
    in Java

    Creating a new JComponent

    Hey, I'm trying to create a small program which displays several circles across the screen. However, I intend for these circles to be clickable and change color, size... on different mouse events on each object. So in order for the Class circle to be added to a JPanel and to register events, it should extend the JComponent class. Of course not JComponent since it is abstract. So which one? JPanel, JLabel... Thank you.
    See more | Go to post

  • rpm27
    started a topic Import declaration
    in Java

    Import declaration

    Hey, I have a small style question. Which import style is preferable (or better) to use. A single one like
    Code:
    import java.util.System;
    or an import-on-demand like
    Code:
    import java.util.*;
    ? Is there any advantage or disadvantage for each declaration? Thank you.
    See more | Go to post

  • rpm27
    replied to Timer
    in Java
    Thank you for your answers. the Timer seems to be the most interesting solution, I'll check the API documentation right away. Thanks again.
    See more | Go to post

    Leave a comment:


  • rpm27
    started a topic Timer
    in Java

    Timer

    Hi, I have written a solitaire game (a very small one) but I want to add a timer which will run while i'm playing and will give me the time spent on the game. I imagine it will need multithreading. I'm I right?
    See more | Go to post

  • rpm27
    started a topic Eclipse, NetBeans, Java Studio Creator
    in Java

    Eclipse, NetBeans, Java Studio Creator

    Hi, I am in the process of learning Java. I have been using Eclipse to try some simple example code. However, I am thinking of trying NetBeans since it has a GUI editor. And last, in my Java book, the author recommends using Java Studio Creator 2 in order to build applications.

    Could someone explain to me what is the difference between these three IDEs, and possibly which one us the best. Thank you
    See more | Go to post

  • rpm27
    started a topic JFrame and JPanel
    in Java

    JFrame and JPanel

    I'm new to Java. I am starting to understand Java GUI dimension (the swing library), and I need someone to clarify something to me: As far as I know, JFrame objects provide a window (with the maximize, minimize, close buttons, and a title bar), and JPanel provide a space for graphics, however they both are containers and can contain other JComponents (Buttons...). My question is, in what case should I add my components directly to a JPanel object,...
    See more | Go to post

  • rpm27
    started a topic Softwares written in Java
    in Java

    Softwares written in Java

    I was wondering what are some of the important softwares that are entirely or mostly written in Java. I heard that LimeWire is. Does someone know?
    See more | Go to post

  • rpm27
    started a topic New to Java - What to download
    in Java

    New to Java - What to download

    I'm starting to learn Java (after I learned C++), however, as the different tutorials are telling me, I should download the JDK + an IDE (eg. Eclipse). Could someone tell me what these different components really do: JDK, JRE and IDE (I think an IDE is analogous to a compiler right?) Thank you
    See more | Go to post

  • rpm27
    started a topic Delaying the program
    in C

    Delaying the program

    Is there a way in C++ to delay the program (for example before it displays something or calls a function) by a certain amount of seconds? I know it it possible in JavaScript, but is it in C++? Thank you.
    See more | Go to post

  • rpm27
    replied to Getline problem
    in C
    Thank you. I'll do that. :-)
    See more | Go to post

    Leave a comment:


  • rpm27
    replied to Getline problem
    in C
    I retried it again and it is giving me the same fault. I know that the code is too simple to have any hidden faults, so could it be from my OS or compiler?
    I am using Windows XP Home Edition SP2, and my compiler is Microsoft Visual C++ 6.0
    See more | Go to post

    Leave a comment:


  • rpm27
    replied to Passing global variables
    in C
    I retried to declare them with global variables and it worked.
    I has to add the #if !defined statements.
    Thank you.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...