• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Is it possilbe to create Gantt chart without any tool

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I want to create a Gantt chart for scheduling in applet...Can anyone say me,how to create it without any tool and is there any sample program avilable..Help me,guys!!!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming by "without tools" you mean without some 3rd party library, this boils down to drawing text, lines and boxes in a GUI component. It doesn't make a difference whether this happens in an applet or an application, provided the code can get at the data somehow.

Have you used Swing (or AWT) before? If not, the Swing chapter of the Java Tutorial will get you going. Since you'll be doing custom painting, this section is highly relevant.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply...
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to draw the line inside the tabel i.e., in a particular cell of a tabel..How can i achieve it?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by table - a JTable object? If so, you can use a custom TableCellRenderer for it. If you mean something else, tell us what objects/components you're using.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes,i mean JTabel...Thank you...
I don't want my Cell and column lines to visible...how can i do it
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JTable has a "show grid on/off" feature; check the javadocs for the correct method names.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply...
I used Table for displaying the gantt chart thinking that the lines will not overlap...Is there any other way for displaying the chart...
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there any other way for displaying the chart...[/QB]


You can use graphics to draw boxes, lines, text, etc. using the Graphics object in the paintComponent method of a JPanel, as I mentioned earlier.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to draw lines inside the rectangle with equal spaces along with a string..How can i?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't really picture what you're describing; can you show us an image of it?

Neither text nor lines nor rectangles are difficult to draw using the Graphics object; what makes the composition difficult?
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is it possible to create Gantt chart without any tool ?



Yes, of course. I believe the tools are using the same JDK available to you.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If then can please show me some sample program..
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Roseanne was getting it is that -since a library like JFreeChart, which can produce Gantt charts, is written in Java- it's certainly possible to do the same in your code without using the library. Obviously, that involves duplicating a lot of effort that has gone into the library. Which brings us to the question: why don't you want to use the library?

As to your question about sample code: tell us in detail -if possible with an image- what it is you're struggling to accomplish. As I said, I'm having a hard time picturing what "lines inside the rectangle with equal spaces along with a string" would look like.
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shalini gnana:
If then can please show me some sample program..



Easy, take a look at source code of jFreeChart. It is a tool, and also it can be used as a teacher too.

jFreeChart is open source, do you know what does that mean?
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot,for your effort in answering...
If i use it..I doesn't make any difference?How can i use that library functions in my IDE?
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to draw the chart for Scheduling...I use rectangle for displaying the dates on the top of the graph..within the rectangle i want to display the time by marking small lines
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to add tree to be displayed at the left..But my tree is not showing..


[ October 19, 2007: Message edited by: Ulf Dittmer ]
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shalini gnana:

If i use it..I doesn't make any difference?How can i use that library functions in my IDE?



Put jfreechart.jar in your classpath.

Check your IDE classpath/buildpath options.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The tree you're adding is empty - the code never does anything with rootnode, nor is createNodes() ever called.


Don't ever call the constructor of an applet. If you need a reference to the applet object, pass the reference "this" around.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where should i have to add my "rootnode" and "createNode()"?
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using NetBeans..I tried to add,Jfreechart..But i couldn't..
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shalini gnana:
I'm using NetBeans..I tried to add,Jfreechart..But i couldn't..



Let's keep questions about this out of this thread. If you need help with NetBeans, start a new thread in the IDE forum.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's often best to start simple to get something going. The following code snippet demonstrates how to get something running without the JScrollPane. Have a look at it to understand what it does. If you then have questions on how to proceed, start a new thread; this one is getting a bit long.

 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you...
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm creating a gantt chart..when i expand the tree the task coresponding to the leaf node have to show and if i close the leaf node,the corresponding task should not show..
How can i do it..I have created a tree..
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IS there any method to do it?
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IS there any method to do it?
reply
    Bookmark Topic Watch Topic
  • New Topic