Ajith Veera

Greenhorn
+ Follow
since Aug 30, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ajith Veera

I am working on a java project that makes use of AndroMDA and maven. Windows OS

I downloaded the binary of apache "mvn -help" works but when I hit "mvn" on the cmd I get the following

Please help me with this

cheers

this is my "settings.xml



The below is my pom.xml of the project

10 years ago

Thanks Maneesh,

and I got over the problem. FYI it is for an academic assignment.

cheers
11 years ago
Oh thanks Bruke,

For the SSCCE it happened that the call is from main thread, but in my code I am sure that I am following the rule.

Thanks for identifying my mistake.

cheers
11 years ago
@Maneesh and Bruke

please find the SSCCE.

I have compiled the below code and its producing the same exception as in my original code.
so please take a look.



I could not create a more shorter version of my code. But from my next posts I will try.

Thanks
11 years ago
sorry Maneesh,
let me get back.

cheers
11 years ago
SSCCE:

The tasks at hand are to "remove all the components of the Jinternal Frame", "add a specific number of columns" and then "add rows" to the Jtable.
so I have 3 methods.

1. setNewContainers()
2. insertColumns()
3. insertRows()


private void removeAll() {

table = null;
internalFrame.getContentPane().removeAll();
internalFrame.validate();

table = new JTable(0,0);
JScrollPane scrollPane = new JScrollPane(table);

internalFrame.getContentPane().add(scrollPane);

internalFrame.validate();


}

private void insertColumns() {

//add columns to the column model of the table
for(int i=0;i<totalColumns;i++){
table.getColumnModel().addColumn(new TableColumn());
}
}

private void insertRows(){

String[] rowData = getRowData();
((DefaultTableModel)table.getModel()).addRow(rowData);

}

and that is it. These methods are called when I select a Tree node i.e a Tree selection event

am I doing some thing wrong???
so any help.......please
11 years ago
Hi Bruke, yes I verified that all the methods are being invoked on EDT by using "javax.swing.SwingUtilities.isEventDispatchThread()".

It always returned true while the control was in each of the methods. So I believe that all the methods are invoked on EDT.

but still the same exception:(.

any further help please

cheers,
Ajith
11 years ago
Hi Bruke

Thanks for the tip and

What I am confident of is that I did not use any threads in my code, but either ways, how do I make sure that all the methods(Swing methods) are called in EDT.

cheers,
Ajith
11 years ago
Hi Ranganathan,
Thank you

The exception I posted is on an eclipse from ubuntu OS. Some one told me that it is better to view SWING components on a windows OS, so when tried to run the same code in Windows & eclipse I got the below and as you have asked, even on ubuntu there was no line number specified in the exception printed in the console.

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
at java.util.Vector.elementAt(Unknown Source)
at javax.swing.table.DefaultTableModel.getValueAt(Unknown Source)
at javax.swing.JTable.getValueAt(Unknown Source)
at javax.swing.JTable.prepareRenderer(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager$3.run(Unknown Source)
at javax.swing.RepaintManager$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.access$1000(Unknown Source)
at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(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)

and I coped the entire code. As suggested I am no where else modifying the table.

Cheers,
Ajith
11 years ago
hi very new to posting questions int this forum

I am from a non technical background so please dont mind any newbie questions:

Please help with the following exception

Exception in thread "AWT-EventQueue-3" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
at java.util.Vector.elementAt(Vector.java:447)
at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:650)
at javax.swing.JTable.getValueAt(JTable.java:2715)
at javax.swing.JTable.prepareRenderer(JTable.java:5715)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2108)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2010)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1806)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:765)
at javax.swing.JComponent.paint(JComponent.java:1029)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JViewport.paint(JViewport.java:764)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:581)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:866)
at javax.swing.JComponent.paint(JComponent.java:1038)


@Code:
[Added code tags - see UseCodeTags for details]
cheers!!



11 years ago