User Profile

Collapse

Profile Sidebar

Collapse
nt5515
nt5515
Last Activity: Mar 4 '08, 04:23 PM
Joined: Feb 15 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Please Help! Changing a graphic via a menu with listeners

    hey Im trying to make a game of pairs (the memory game) i have set up a grid which displays a graphic for the card back. im trying to link the edit menu to choose the graphic to be displayed. i've set up a string variable called deck which will contain the path to the required image. and actionlisteners DA and DB corresponding to which style is choosen in the menu. I had to declare the deck to some initial image so it can load.
    How do i impliment...
    See more | Go to post

  • nt5515
    started a topic resizing a graphic inside a JPanel
    in Java

    resizing a graphic inside a JPanel

    Hi
    I've set up an array of Jpanels in a grid layout. im trying to insert a graphic into each panel using a loop. i can get the graphic in but it sits in the bottom right of each panel, and i've tried setting the layout and the size but nothing happens.

    Is there any way which i can set the graphic to be the same size as the JPanel, so when i resize the window the graphic will resize automaticaly.

    Any ideas??...
    See more | Go to post

  • nt5515
    replied to Sub menu in a GUI
    in Java
    Ah i see. that worked a treat..thank you
    Niall...
    See more | Go to post

    Leave a comment:


  • nt5515
    started a topic Sub menu in a GUI
    in Java

    Sub menu in a GUI

    Does anyone know how to crewat a submenu? i've got a menu with several items and i want to split it into submenus but cant find a way to do it.

    Any suggestion are welcome
    Thanks in advance!
    See more | Go to post

  • hey thank guys, i managed to do it here wot i did
    Code:
    public void actionPerformed(ActionEvent event)
        {
            String source = event.getActionCommand();
        
        if(source.equals("A"))
        {
    	newGame(4, 3);
        }
        if (source.equals("B"));
        {
     	newGame(4, 4);
        }
        if(source.equals("C"));
        {
    	newGame(5,
    ...
    See more | Go to post

    Leave a comment:


  • i mean if i had a button in the initial frame class how do i get it to open a new grid frame with a variable size? on the first screen there is three buttons each of which will open a new frame with a grid size depending on which button is pressed.

    heres the code for the first window..the A B and C buttons will open new frames.

    Code:
     import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import
    ...
    See more | Go to post

    Leave a comment:


  • nt5515
    started a topic action listener and linking classes Please help!
    in Java

    action listener and linking classes Please help!

    i've just started using java and im trying to develop a GUI that will play a game. i have a start screen with some Jbuttons. The button represent 3 sizes of the game grid, when these are pressed i want a a new frame to open ith the game grid. i've already writen the class containing the game grid, and need to know how to use the actionlistener to relate the initial class to the new class. Also depending on which button is pressed, will change the...
    See more | Go to post

  • nt5515
    replied to Event Queues
    in Java
    heres the info i recieved about the question:

    The purpose of the EventQueue class is to store all the events that "haven't happened yet" (according to the simulated current time). The events are taken out of the queue in order of increasing time. Here's a starting point for your class:

    EventQueue.java

    The EventQueue class stores events in an array which is bigger than is needed. For now, you...
    See more | Go to post

    Leave a comment:


  • nt5515
    replied to Event Queues
    in Java
    hey sorry bout not using th [code] tags. im new to this and didnt know how. I had considered using a tree structure but the question does state the use of an array. I think its more an exercise in manipulating the array resizing and sorting etc.

    could you tell me how to add a new event to the array? please
    See more | Go to post

    Leave a comment:


  • nt5515
    started a topic Event Queues
    in Java

    Event Queues

    im trying to write a program that store a binary tree of possible events in an array. i need to be able to sort the the Events in the array based on the previous event that caused it by the time which they will occur. After the specific time has passed the event will be removed and all other events will be bumped up, all the while new events will be added to the end and sorted by their time.

    Please Help

    heres wot i've...
    See more | Go to post
    Last edited by BigDaddyLH; Feb 15 '08, 04:58 PM. Reason: added code tags
No activity results to display
Show More
Working...