My main idea is to link the three combo boxes
I had taken appSet, app, package comboboxes
Now when I select one iten in appSet then the remaining two comboboxes should show the data related to the selected item in the appSet
and when I select one item in the app combo box then the package combo box should show the related items of the item which I had selected in the app combo box.
I had used a piece of code but it showing the following errors when I am executing
and there are no errors in the code
AWT-EventQueue-0" java.lang.NullPointerException
at client.cpm.dailyT20.CBRCPMDailyT20View.appComboBox_actionPerformed(CBRCPMDailyT20View.java:235)
at client.cpm.dailyT20.CBRCPMDailyT20View.access$1(CBRCPMDailyT20View.java:234)
at client.cpm.dailyT20.CBRCPMDailyT20View$2.actionPerformed(CBRCPMDailyT20View.java:227)
at javax.swing.JComboBox.fireActionEvent(Unknown Source)
at javax.swing.JComboBox.contentsChanged(Unknown Source)
at javax.swing.JComboBox.intervalRemoved(Unknown Source)
at javax.swing.AbstractListModel.fireIntervalRemoved(Unknown Source)
at javax.swing.DefaultComboBoxModel.removeAllElements(Unknown Source)
at javax.swing.JComboBox.removeAllItems(Unknown Source)
at client.cpm.dailyT20.CBRCPMDailyT20View.appSetComboBox_actionPerformed(CBRCPMDailyT20View.java:187)
at client.cpm.dailyT20.CBRCPMDailyT20View.access$0(CBRCPMDailyT20View.java:183)
at client.cpm.dailyT20.CBRCPMDailyT20View$1.actionPerformed(CBRCPMDailyT20View.java:175)
at javax.swing.JComboBox.fireActionEvent(Unknown Source)
at javax.swing.JComboBox.setSelectedItem(Unknown Source)
at javax.swing.JComboBox.setSelectedIndex(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I am including the code here
package client.cpm.dailyT20;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.sql.Date;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDesktopPane;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.event.InternalFrameEvent;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import cbrdataejb.entity.CBRCommentPK;
import cbrdataejb.session.CBRCPMDailyT20FactTable;
import cbrdataejb.session.CBRCPMDailyT20FactTableRemote;
import cbrutil.CBRCursor;
import cbrutil.CBRError;
import cbrutil.CBRExcelDriver;
import cbrutil.CBRUserPreferences;
import client.cpm.dailyT20.detail.CBRCPMDailyT20DetailView;
import client.cpm.dailyT20.table.CBRCPMDailyT20FailCellRenderer;
import client.cpm.dailyT20.table.CBRCPMDailyT20SuccessCellRenderer;
import com.borland.dbswing.TableScrollPane;
import com.borland.dx.dataset.StorageDataSet;
import common.ui.CBRCommentCellRenderer;
import common.ui.CBRCommentedTable;
import common.ui.CBRCommentedView;
import common.ui.CBRDefaultTable;
@SuppressWarnings("serial")
public class CBRCPMDailyT20View extends CBRCommentedView {
// EJB
private CBRCPMDailyT20FactTableRemote factTableRemote;
// GUI attributes
private JPanel toolbarPanel = null;
//private JLabel dateLabel = null;
//private ADateField dateField = null;
private JLabel appSetLabel = null;
private JLabel appLabel = null;
private JLabel packageLabel = null;
private JComboBox appSetComboBox = null;
private JComboBox appComboBox = null;
private JComboBox packageComboBox = null;
private JButton okButton = null;
private JButton T20histButton = null;
private JButton T20confButton = null;
private JButton printButton = null;
private JButton saveAsButton = null;
private TableScrollPane tableScrollPane = null;
private CBRCommentedTable table = null;
public CBRCPMDailyT20View(JDesktopPane desktopPane) {
super(desktopPane);
try {
initialize();
process();
} catch (Exception e) {
e.printStackTrace();
}
}
protected CBRDefaultTable getTableToBePrinted() {
return this.getTable();
}
public String getAppSet() {
return this.getAppSetComboBox().getSelectedItem().toString();
}
public String getApp() {
return this.getAppComboBox().getSelectedItem().toString();
}
private void initialize() throws Exception {
// EJB initialization
factTableRemote = (CBRCPMDailyT20FactTableRemote) super.getContext()
.lookup(CBRCPMDailyT20FactTable.RemoteJNDIName);
// Initialize Data-source
factTableRemote.init(CBRUserPreferences.instance().getDataSource(),
"PRD-CPM", CBRUserPreferences.instance().getPortServer());
// Desktop Pane initialization
setTitle("CPM - T20 DTS Log Report-Summary Data");
this.setPreferredSize(new Dimension(1000, 800));
this.setMinimumSize(new Dimension(750, 600));
// Display of this view
getContentPane().setLayout(new GridBagLayout());
getContentPane().add(
this.getToolbarPanel(),
new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
new Insets(5, 5, 5, 5), 0, 0));
getContentPane().add(
this.getTableScrollPane(),
new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 5, 5, 5), 0, 0));
}
private JPanel getToolbarPanel() {
if (this.toolbarPanel == null) {
this.toolbarPanel = new JPanel();
this.toolbarPanel.setLayout(new GridBagLayout());
this.toolbarPanel.add(this.getAppSetLabel(), new GridBagConstraints(
2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.toolbarPanel.add(this.getAppSetComboBox(),new GridBagConstraints(
3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.toolbarPanel.add(this.getAppLabel(), new GridBagConstraints(
4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.toolbarPanel.add(this.getAppComboBox(),new GridBagConstraints(
5, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.toolbarPanel.add(this.getPackageLabel(), new GridBagConstraints(
6, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.toolbarPanel.add(this.getPackageComboBox(), new GridBagConstraints(
7, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE,new Insets(5, 0, 5, 5), 0, 0));
this.toolbarPanel.add(this.getOkButton(), new GridBagConstraints(
8, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.toolbarPanel.add(this.getPrintButton(),new GridBagConstraints(
9, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.toolbarPanel.add(this.getSaveAsButton(),new GridBagConstraints(
10, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE,new Insets(5, 0, 5, 0), 0, 0));
this.toolbarPanel.add(this.getT20ConfButton(),new GridBagConstraints
(8, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE,new Insets(5, 0, 5, 5), 0, 0));
this.toolbarPanel.add(this.getT20HistButton(),new GridBagConstraints
(9, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE,new Insets(5, 0, 5, 5), 0, 0));
}
return this.toolbarPanel;
}
// creating AppSet Label
private JLabel getAppSetLabel() {
if (this.appSetLabel == null) {
this.appSetLabel = new JLabel("App Set:");
}
return this.appSetLabel;
}
//Getting data into APPSet Combo Box
private JComboBox getAppSetComboBox() {
if (this.appSetComboBox == null) {
this.appSetComboBox = new JComboBox();
// Populate the App Set list
this.appSetComboBox.addItem("All Application");
ArrayList<String> anAppSetList = CBRCPMDailyT20AppManager.instance()
.getAppSetList();
for (int i = 0; i < anAppSetList.size(); i++) {
this.appSetComboBox.addItem(anAppSetList.get(i));
}
this.appSetComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent eventset) {
appSetComboBox_actionPerformed(eventset);
}
});
}
return this.appSetComboBox;
}
//Implementing the action listener
private void appSetComboBox_actionPerformed(ActionEvent eventset) {
String appSet = this.getAppSetComboBox().getSelectedItem().toString();
//String appSet = "AMADEUS_ABG";
this.appSetComboBox.setSelectedItem(appSet);
this.getAppComboBox().removeAllItems();
this.getPackageComboBox().removeAllItems();
this.appComboBox.addItem("All Application");
this.packageComboBox.addItem("All Application");
ArrayList<String> anAppList = CBRCPMDailyT20AppManager.instance()
.getAppList(appSet);//replace by appSet
for (int i = 0; i < anAppList.size(); i++) {
this.appComboBox.addItem(anAppList.get(i));
}
ArrayList<String> anPackageList = CBRCPMDailyT20AppManager.instance()
.getPackageList(appSet);//replace by appSet
for (int l = 0; l < anPackageList.size(); l++) {
this.packageComboBox.addItem(anPackageList.get(l));
}
this.appComboBox.setSelectedIndex(0);
this.packageComboBox.setSelectedIndex(0);
}
//creating App Label
private JLabel getAppLabel() {
if (this.appLabel == null) {
this.appLabel = new JLabel("Application:");
}
return this.appLabel;
}
//Getting data for App Combo Box
private JComboBox getAppComboBox() {
if (this.appComboBox == null) {
this.appComboBox = new JComboBox();
// Populate the App list
this.appComboBox.addItem("All Application");
ArrayList<String> anAppList = CBRCPMDailyT20AppManager.instance()
.getAppList();
for (int j = 0; j < anAppList .size(); j++) {
this.appComboBox.addItem(anAppList .get(j));
}
this.appComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent eventpack) {
appComboBox_actionPerformed(eventpack);
}
});
}
return this.appComboBox;
}
private void appComboBox_actionPerformed(ActionEvent eventpack) {
String app = this.getAppComboBox().getSelectedItem().toString();
//String appSet = "AMADEUS_ABG";
this.appComboBox.setSelectedItem(app);
this.getPackageComboBox().removeAllItems();
this.packageComboBox.addItem("All Application");
ArrayList<String> anPackageList = CBRCPMDailyT20AppManager.instance()
.getPackageList(app);//replace by app
for (int j = 0; j < anPackageList.size(); j++) {
this.packageComboBox.addItem(anPackageList.get(j));
}
this.packageComboBox.setSelectedIndex(0);
}
/*private void appComboBox_actionPerformed(ActionEvent event) {
String appSetCombo = this.getAppSetComboBox().getSelectedItem().toString();
String app = this.getAppComboBox().getSelectedItem().toString();
//String appSetCombo = "AMADEUS_CPM";
//String app = "FINANCE";
this.appComboBox.setSelectedItem(app);
this.appSetComboBox.setSelectedItem(appSetCombo);
this.getPackageComboBox().removeAllItems();
this.packageComboBox.addItem("All Package");
ArrayList<String> anPackageList = CBRCPMDailyT20AppManager.instance()
.getPackageList(appSetCombo, app);
for (int i = 0; i < anPackageList.size(); i++) {
this.packageComboBox.addItem(anPackageList.get(i));
}
this.packageComboBox.setSelectedIndex(0);
}*/
// Creating package Label
private JLabel getPackageLabel() {
if (this.packageLabel == null) {
this.packageLabel = new JLabel("Package:");
}
return this.packageLabel;
}
//Getting Data for package combo box
private JComboBox getPackageComboBox() {
if (this.packageComboBox == null) {
this.packageComboBox = new JComboBox();
// Populate the Package list
this.packageComboBox.addItem("All Package");
ArrayList<String> anPackageList = CBRCPMDailyT20AppManager.instance()
.getPackageList();
for (int i = 0; i < anPackageList.size(); i++) {
this.packageComboBox.addItem(anPackageList.get(i));
}
}
return this.packageComboBox;
}
private JButton getOkButton() {
if (this.okButton == null) {
this.okButton = new JButton("OK");
// Add a listener
this.okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
okButton_actionPerformed(event);
}
});
}
return this.okButton;
}
private void okButton_actionPerformed(ActionEvent event) {
process();
}
private JButton getPrintButton() {
if (this.printButton == null) {
this.printButton = new JButton("Print");
// Add a listener
this.printButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
printButton_actionPerformed(event);
}
});
}
return this.printButton;
}
private void printButton_actionPerformed(ActionEvent event) {
printTable(getTable());
}
private JButton getSaveAsButton() {
if (this.saveAsButton == null) {
this.saveAsButton = new JButton("Save As...");
// Add a listener
this.saveAsButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
saveAsButton_actionPerformed(event);
}
});
}
return this.saveAsButton;
}
private void saveAsButton_actionPerformed(ActionEvent event) {
try {
CBRExcelDriver excel = new CBRExcelDriver();
excel.saveFile(this, this.getTable(), "CPM Daily T20 FactTable");
} catch (Exception e) {
e.printStackTrace();
}
}
private JButton getT20HistButton() {
if (this.T20histButton == null) {
this.T20histButton = new JButton("T20History");
// Add a listener
this.T20histButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
T20histButton_actionPerformed(event);
}
});
}
return this.T20histButton;
}
private void T20histButton_actionPerformed(ActionEvent event){
}
private JButton getT20ConfButton() {
if (this.T20confButton == null) {
this.T20confButton = new JButton("T20Config");
// Add a listener
this.T20confButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
T20confButton_actionPerformed(event);
}
});
}
return this.T20confButton;
}
private void T20confButton_actionPerformed(ActionEvent event){
/*CBRCPMDailyT20ConfView cpmDailyT20ConfView = new CBRCPMDailyT20ConfView(this.getDesktopPane());
cpmDailyT20ConfView.setBounds(0, 0, 1000, 700);
cpmDailyT20ConfView.setLocation(0, 0);
cpmDailyT20ConfView.setVisible(true);*/
}
private TableScrollPane getTableScrollPane() {
if (this.tableScrollPane == null) {
this.tableScrollPane = new TableScrollPane();
// Associate the OLA table to the table scroll pane
this.tableScrollPane.getViewport().add(this.getTable(), null);
this.tableScrollPane.setBorder(BorderFactory.createEtchedBorder());
}
return this.tableScrollPane;
}
private CBRDefaultTable getTable() {
if (this.table == null) {
this.table = new CBRCommentedTable(this);
this.table.getTableHeader().setReorderingAllowed(false);
this.table.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
table_mouseClicked(event);
}
});
this.table.addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseMoved(MouseEvent event) {
table_mouseMoved(event);
}
});
}
return this.table;
}
/*private void table_mouseClicked(MouseEvent event) {
Point origin = event.getPoint();
int row = this.getTable().rowAtPoint(origin);
int column = this.getTable().columnAtPoint(origin);
if (row == -1 || column == -1) {
return;
}
if (event.getClickCount() == 1) {
int logFileColId = this.getTable().getColumnModel().getColumnIndex(
"Log File");
if (column == logFileColId) {
String logFilePath = this.getTable().getValueAt(row, column)
.toString();
String shortLogFilePath = logFilePath.substring(logFilePath
.indexOf("CPMData"));
try {
JTextArea textArea = new JTextArea();
textArea.read(new FileReader(
"\\\\muceap10.muc.amadeus.net\\Everest_Webfolders\\"
+ shortLogFilePath), null);
textArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(textArea);
JOptionPane optionPane = new JOptionPane(scrollPane,
JOptionPane.INFORMATION_MESSAGE);
JDialog dialog = optionPane.createDialog(this, logFilePath);
dialog.setSize(750, 500);
dialog.setLocation(50, 50);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}*/
private void table_mouseClicked(MouseEvent event) {
Point origin = event.getPoint();
int row = this.getTable().rowAtPoint(origin);
//int column = this.getTable().columnAtPoint(origin);
/*if (row == -1 || column == -1) {
return;
}
if (event.getClickCount() == 1) {
int logFileColId = this.getTable().getColumnModel().getColumnIndex(
"Log File");
if (column == logFileColId) {
String logFilePath = this.getTable().getValueAt(row, column)
.toString();
String shortLogFilePath = logFilePath.substring(logFilePath
.indexOf("CPMData"));
try {
JTextArea textArea = new JTextArea();
textArea.read(new FileReader(
"\\\\muceap10.muc.amadeus.net\\Everest_Webfolders\\"
+ shortLogFilePath), null);
textArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(textArea);
JOptionPane optionPane = new JOptionPane(scrollPane,
JOptionPane.INFORMATION_MESSAGE);
JDialog dialog = optionPane.createDialog(this, logFilePath);
dialog.setSize(750, 500);
dialog.setLocation(50, 50);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
}
else*/ if (event.getClickCount() == 2) {
// Wait Cursor.
CBRCursor waitCursor = new CBRCursor(this);
try {
// Get one month back in the past
int appSetColumnIndex = this.getTable()
.convertColumnIndexToView(
this.getTable().getColumn("ApplicationSet")
.getModelIndex());
String appSet = (String) this.getTable().getValueAt(row,
appSetColumnIndex);
int appColumnIndex = this.getTable().convertColumnIndexToView(
this.getTable().getColumn("Application").getModelIndex());
String app = (String) this.getTable().getValueAt(row,
appColumnIndex);
int packageColumnIndex = this.getTable().convertColumnIndexToView(
this.getTable().getColumn("Package").getModelIndex());
String packageS = (String) this.getTable().getValueAt(row,
packageColumnIndex);
// Get Counting data
CBRCPMDailyT20DetailView detailView = new CBRCPMDailyT20DetailView(
this.getDesktopPane(), appSet, app, packageS);
detailView.setBounds(0, 0, 900, 600);
detailView.setLocation(50, 50);
detailView.show();
} catch (Exception e) {
e.printStackTrace();
} finally {
waitCursor.reset();
}
}
}
private void table_mouseMoved(MouseEvent event) {
Point origin = event.getPoint();
int row = this.getTable().rowAtPoint(origin);
int col = this.getTable().columnAtPoint(origin);
if ((row == -1) || (col == -1)) {
return;
}
String columnName = this.getTable().getColumnName(col);
if ((columnName.equals("ApplicationSet"))
|| (columnName.equals("Application"))
|| (columnName.equals("Package"))){
this.getTable().setCursor(new Cursor(Cursor.HAND_CURSOR));
} else {
this.getTable().setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}
private void process() {
// Wait Cursor.
CBRCursor waitCursor = new CBRCursor(this);
try {
// Get the chosen application
String appSet = this.getAppSetComboBox().getSelectedItem().toString();
String app = this.getAppComboBox().getSelectedItem().toString();
String packageS = this.getPackageComboBox().getSelectedItem().toString();
// Get daily data
StorageDataSet data = new StorageDataSet();
factTableRemote.getData(appSet,app,packageS).loadDataSet(data);
// Associate the dataset with the table component.
this.getTable().setDataSet(data);
// Define the cell customization of the table
TableColumnModel tableColumnModel = this.getTable()
.getColumnModel();
for (int col = 0; col < this.getTable().getColumnCount(); col++) {
String columnName = this.getTable().getColumnName(col);
TableColumn column = tableColumnModel.getColumn(col);
if (columnName.equals("ApplicationSet")) {
column.setCellRenderer(new CBRCommentCellRenderer(this));
column.setPreferredWidth(100);
} else if (columnName.equals("Application")) {
column.setPreferredWidth(120);
} else if (columnName.equals("Package")) {
column.setPreferredWidth(300);
} else if ((columnName.equals("SE_Min"))
|| (columnName.equals("SE_Max"))
|| (columnName.equals("SE_Avg"))) {
column.setCellRenderer(new CBRCPMDailyT20SuccessCellRenderer());
column.setPreferredWidth(60);
}
else if ((columnName.equals("FE_Max"))
|| (columnName.equals("FE_Min"))
|| (columnName.equals("FE_Avg"))) {
column.setCellRenderer(new CBRCPMDailyT20FailCellRenderer());
column.setPreferredWidth(60);
}
else if ((columnName.equals("SE"))
|| (columnName.equals("FE"))) {
column.setPreferredWidth(40);
}
else if (columnName.equals("Last_Execution")){
column.setPreferredWidth(80);
}
}
// Make the GUI visible.
this.getTable().setVisible(true);
} catch (Exception e) {
CBRError.displayServerError(this, e);
} finally {
waitCursor.reset();
}
}
@Override
protected void this_internalFrameClosed(InternalFrameEvent e) {
try {
factTableRemote.remove();
CBRCPMDailyT20AppManager.instance().removeEJB();
} catch (Exception ex) {
}
}
@Override
public CBRCommentPK getCommentKey(int currentRowNumber,
int currentColumnNumber, CBRCommentedTable currentTable) {
try {
int appColId = currentTable.getColumnModel().getColumnIndex(
"ApplicationSet");
int catColId = currentTable.getColumnModel().getColumnIndex(
"Package");
String appValue = currentTable.getValueAt(currentRowNumber,
appColId).toString();
String catValue = currentTable.getValueAt(currentRowNumber,
catColId).toString();
String commentKey = appValue + "-" + catValue;
Date date = Date.valueOf("2009-01-01");
return new CBRCommentPK("CPM - T20 DTS Log Report", commentKey, date);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public CBRCommentPK getCurrentCommentKey() {
try {
int rowId = this.getTable().getSelectedRow();
if (rowId == -1) {
return null;
}
int appColId = this.getTable().getColumnModel().getColumnIndex(
"ApplicationSet");
int catColId = this.getTable().getColumnModel().getColumnIndex(
"Package");
String appValue = this.getTable().getValueAt(rowId, appColId)
.toString();
String catValue = this.getTable().getValueAt(rowId, catColId)
.toString();
String commentKey = appValue + "-" + catValue;
Date date = Date.valueOf("2009-01-01");
return new CBRCommentPK("CPM - T20 DTS Log Report Detail", commentKey, date);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
So can any one please help me
It is very urgent and it is my first time experience in programming
I dont have any exp before
and I dont have any collegues to help
Thank in Advance