Results 1 to 4 of 4
  1. #1
    czepluch is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Need help drawing an overview

    Hi, I am studying software delelopment and we are currently learning Java.
    I have been given an assignment to draw an overview over cars booked in a car booking system.
    There is a list of cars eg. (Golf, Mustang, Civic, Fiesta, Picasso) on the y axis and the coming 14 days on the x axis.
    Then there has to be some way to mark in which periods a given car is booked. I am thinking this can be done with the paintComponent() method, but I have no idea how to do it.

    Any help would be appreciated.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Need help drawing an overview

    This could also be done with a JTable where your days are the headers and your have a right column with Car names. The cells could say change color if the car should be booked.

    But having said that, you could also do this in paintComoponent if desired, or perhaps easier using a JPanel that holds a gridlayout of opaque JLabels.

  3. #3
    czepluch is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Re: Need help drawing an overview

    Quote Originally Posted by Fubarable View Post
    This could also be done with a JTable where your days are the headers and your have a right column with Car names. The cells could say change color if the car should be booked.

    But having said that, you could also do this in paintComoponent if desired, or perhaps easier using a JPanel that holds a gridlayout of opaque JLabels.
    Thanks for the answer. I know that all these possibilities exist. I, however do not know how to use them. But the API must help me with that.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Need help drawing an overview

    You'll need to break your big problem down into little problems and do first things first. I'd think of the logic first, of what data structures would hold this information and how I'd update the data -- basically try to plan the "model" of your program. Then I'd think of the GUI to display the information, again breaking it down into little solvable steps, and finally how to connect the two.

Similar Threads

  1. Drawing a map
    By Karp in forum AWT / Swing
    Replies: 4
    Last Post: 11-07-2008, 12:26 PM
  2. Maven Dependency Overview 1.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-02-2008, 07:13 PM
  3. Maven Dependency Overview 1.0
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-15-2008, 06:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •