User Profile

Collapse

Profile Sidebar

Collapse
kalar
kalar
Last Activity: Feb 18 '14, 02:16 PM
Joined: Aug 8 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • kalar
    replied to explain a prototype of function
    in C
    coroutine *co_start(void (*body) (void*), void *attr);

    coroutine *co_start . This means that i should make a function co_start that returns a pointer to coroutine.

    void (*body) (void*) is one of the arguments of the function.This argument is a pointer to a function body.This function takes as argument a pointer to void.

    the second argument void *attr of the function co_start is a pointer to void.
    ...
    See more | Go to post

    Leave a comment:


  • kalar
    started a topic explain a prototype of function
    in C

    explain a prototype of function

    Hello!!!
    I have to write a function and they are giving me the prototype of the function, but i don't understand what arguments takes.
    the prototype is:
    Code:
    coroutine *co_start(void (*body) (void*), void *attr);
    can you explain me what arguments take this function and what returns?
    I am really confused.
    See more | Go to post

  • kalar
    replied to super and paint component
    in Java
    where, i mean in the jpanel or in the jframe?
    See more | Go to post

    Leave a comment:


  • kalar
    replied to super and paint component
    in Java
    I am confused know.I understand that my program works because i make setOpaque(false ).But where did i paint my picture??? in the Jpanel ?? or back in the JFrame??
    See more | Go to post

    Leave a comment:


  • kalar
    replied to super and paint component
    in Java
    thank you @BigDaddyLH but let me know if i understad good.
    The super.paintComp onent method clears the panel. So if i call it after everything i draw
    is deleted.If i never call it java call its for me. Right????
    BUT why in my programm if i put before and after is the same thing?
    i mean that if i put it after it doesn't delete what has been drawn?

    Maybe the super is called always first , like static is always...
    See more | Go to post

    Leave a comment:


  • kalar
    started a topic super and paint component
    in Java

    super and paint component

    I have a code something like this:
    Code:
    public class panelPic extends JPanel
    {
                   .......................
    
                protected void paintComponent(Graphics g)
                {  
                         //super.paintComponent(g);
                         g.setColor(Color.RED);
                         g.drawString ("hello",d.width/2, d.height/2);
    ...
    See more | Go to post

  • kalar
    replied to problem: open a frame in a thread
    in Java
    Thank you veru much!!! it works
    See more | Go to post

    Leave a comment:


  • kalar
    started a topic problem: open a frame in a thread
    in Java

    problem: open a frame in a thread

    I want to have a thread and in this thread i want to make a JFrame window
    i try this but i think it doesn't work correct:
    Code:
    public class AboutWindow  implements Runnable
    {
            Thread hello ;
            public AboutWindow()
            {
            	hello = new Thread();
            	hello.start();
    
            }
        
        public static void main(String[] args)
        {
    ...
    See more | Go to post

  • kalar
    replied to JButton and a new Frame
    in Java
    Thank you Jos!!!! It works.
    Now is there a way to close only the first window(it goes back from the mainFrame of the game ) or the first Thread(if i say it correct) and leave the mainFrame of the game or the second thread as it is in order to play?
    See more | Go to post

    Leave a comment:


  • kalar
    replied to JButton and a new Frame
    in Java
    yes the sound plays but as you can see in the image in my post the second window doesn' t show anything. It shows the first window and the code from jcreator that is opened behined the programm.
    it should be like this the second window

    i take this picture when i run the main method from the mainFrame game
    this main has the same code with this in ActionPerformed...
    See more | Go to post

    Leave a comment:


  • kalar
    replied to JButton and a new Frame
    in Java
    so in ActionPerformed i am doing:
    Code:
        public void actionPerformed(ActionEvent e)
        {
        	if ("play".equals(e.getActionCommand()))
        	{
        	SwingUtilities.invokeLater(new Runnable() {
      
                public void run() {
      
                 Game.modif();//this  just fill some arrays
                 Game frame = new Game();//here is the mainFrame of the game
    ...
    See more | Go to post

    Leave a comment:


  • kalar
    replied to JButton and a new Frame
    in Java
    i make what you say jos but it didn't work.Look now what it happens(i delete the picture in the first window)


    when i push play it opens the second window,it plays the music that i have put but it shows me back of the screen ,the first window and the code in Jcreator,which i have open him...
    See more | Go to post

    Leave a comment:


  • kalar
    replied to JButton and a new Frame
    in Java
    Thank you jos but i wouldn't like to learn about threads now.I don't have the time.
    Is there any way to close the first window(not to setVisible(fals e) but close it) and then run the main from the other class?(all these in Action Performed)
    See more | Go to post

    Leave a comment:


  • kalar
    started a topic JButton and a new Frame
    in Java

    JButton and a new Frame

    Hello. I got a problem with a JButton in a game that i am making.
    I have a mainFrame that is where we play the game.In this class i have a main method in order to test it.We also have a first window.In first window we have a button play and when we push it , we show the mainFrame.

    The problem: When i push the button it shows me the mainFrame but all the window is white.( i should see some pictures and buttons)

    ...
    See more | Go to post

  • kalar
    replied to problem with infinite loop
    in C
    i can't edit my post
    I fix my code and it seems that WORKS fine. I run it over 40 times and it works.
    But how can i check if it is realy correct? I want to put this code into a game so i want to be sure that i will not have an infinite loop again? Can i check it with another way than running it 40,60..... times?
    Thanks
    See more | Go to post

    Leave a comment:


  • kalar
    replied to problem with infinite loop
    in C
    Thanx Banfa. I will try to fix my code.
    Your thought with qsort, i think that doesn't fit in my situation because i should have too many if. I want in array a numbers 10-100, in array b 1-90 and the elements of b should be smaller than a (b[1]<a[1],b[2]<a[2]...). I want the same thing for arrays c and d, So as i am thinking it now , i can't found a way to do it with one array and quicksort...
    See more | Go to post

    Leave a comment:


  • kalar
    replied to problem with infinite loop
    in C
    Of course i didn't write like something like this, i want to tell that i fix both of the loops that i have on my code


    Something else. This is not the full code.
    I want to have 20 random numers (they are different from each other).In a[i] i have 5 numbers and in b[i] i have 5 numbers but they are smaller than a[i](i mean a[1] should be > b[1] , a[2]>b[2], a[3]>b[3]....) The same thing for c and d arrays....
    See more | Go to post

    Leave a comment:


  • kalar
    replied to problem with infinite loop
    in C
    i fix this
    Code:
     while(z<5)   and while (i<5)
    , but still have the same problem.Some times it prints me the array and some times not
    See more | Go to post

    Leave a comment:


  • kalar
    replied to problem with infinite loop
    in C
    why this? I have z variable and before the end of loop i make it z++ , first z=0, then z=1 ....



    i forgot to say that arrays a,b,c have already values(if you mean this) and i want to fill the d array...
    See more | Go to post

    Leave a comment:


  • kalar
    started a topic problem with infinite loop
    in C

    problem with infinite loop

    Hello, i have a problem with an infinite loop.
    I have got 4 arrays , each of them, have 5 integers
    the elements are from random funtcion, I don't want to have same elements in the arrays so i make an if in line 18.The problem:some times the code prints me the 5 elements of d[i] and some times not(it starts to run but it doesn't do no anything- i think tha is an infinite loop)
    Code:
        int a[5];
        int b[5];
    ...
    See more | Go to post
No activity results to display
Show More
Working...