Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i have this error and i dont know how to fix it please help this is the code: import javax.swing.*; public class GanttChart extends JFrame
i have this error and i dont know how to fix it please help
this is the code:
import javax.swing.*;
public class GanttChart extends JFrame {
private JTextArea ganttChartTextArea;
public GanttChart() {
initComponents();
}
private void initComponents() {
ganttChartTextArea = new JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Gantt Chart");
ganttChartTextArea.setEditable(false);
jScrollPane1.setViewportView(ganttChartTextArea);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}
public void updateGanttChart(String chart) {
ganttChartTextArea.setText(chart);
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new GanttChart().setVisible(true);
}
});
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started