Shreyas Rane

Greenhorn
+ Follow
since Apr 10, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shreyas Rane

Hi,

I am trying to change JButton text on mouse click, the JButton is rendered in a JTable.
JButton text gets changed for that JButton but it is not reflected in JTable..
Can any one tell where am i going wrong???


12 years ago
ofcourse you can run it for yourself i just wanted to know if i have followed best coding practices . thanks
12 years ago
Hi Michael Dunn thanks for your reply..

I have removed those redundant setSize() lines..

Actually i was trying to write a swing based desktop application, its a menu driven application. Just wanted to know if i was following the best swing programming practices,
The application runs fine, it needs a bit of testing.

if you want to review the swing (GUI) code i can repost it.

Thanks anyways..
12 years ago
Its a swing application which connects with a Device on N/W and communicates with it.
Is the swing programming part done correctly??
Please review the code.
Thanks in advance

12 years ago
should i buy exam voucher from Oracle or Sun for Java 6 SE Exam ?
I enquired about exam voucher they say both are available..
which one should i buy??

Thanks
Shreyas Rane
I have developed a swing application, i have some issues with application font!!

My development environment :

OS : Fedora 13

Java Version :
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)

ISSUE :
On Fedora (my system) application font looks (normal) ok
but when i tried to run the same app on different OS : Ubuntu , the Font looked a bit bold than what it did on Fedora...

How can this be fixed?

Thanks in advance


12 years ago
Best way to start with Swing is to go through Swing Tutorial on Oracle / Java site as mentioned in above post and just try running all demo swing programs.
Experimenting with your own stuff in provided code would help you learn a bit.. :thumbup:
12 years ago
Hello Martin , Thanks for your input..

When i use allRows Vector in methods inherited / defined by TableModel interface then my Table shows all the Rows (all Data present around 2000 records) and sorting takes place swiftly... [and hence paging is not required as all data is already displayed ]
my need is to display 25 records in table and when search happens on a particular employee firstname based on JCombobox result displayed in table should show all employees for that firstname

any suggestions are appreciated....
12 years ago
I have a SimpleTableModel class which extends AbstractTableModel and EmployeeListView class in which i used SimpleTableModel object and added a TableRowSorter to it

im using hibernate to access database

In SimpleTableModel class im using 2 vectors to store and display results fetched from database
1st Vector to store all records in database
2nd vector to display a set of 25 or specified no of rows in Viewport


TableRowSorter sorts results on FirstName ie FirstName column
The problem is with TableRowSorter object sorter in EmployeeListView class it sorts n displays firstnames only out of displayed 25 rows (Maybe its bad coding logic of mine )
if i comment setDisplayData(fromIndex, toIndex); in SimpleTableModel and set 1st Vector as a datasource then all records are displayed in table n sorting occurs perfectly fine

My Requirement is :
1: to display 25 records is table allow pagination by 4 buttons next,previous,start,last [DONE]
2: to allow sorting by firstname on for all records in 1st Vector [with this im going ]

Any modifications or suggestions on implementation technique would be appreciated....

SimpleTableModel class



EmployeeListView class






12 years ago
I have this method below , in which i want populate a Vector<String> with all employee firstname. That is why type of object which the Vector can hold is String...
I want to modify the method so that i can send ComboBoxModel and Type of objects which the vector can hold.. to decide type of objects in Vector at runtime

Thanks in advance
12 years ago


I have made a few changes to my previous code Pagination was smooth, Searching goes in smooth too.
Still got a issue here , i display 20 records in table while searching if <=20 records are returned for particular employee firstname then it works ok otherwise JVM goes

Any help would be greatly appreciated..
12 years ago
Thanks a ton martin....
12 years ago


The above code displays a Vector of 20 employees in JTable , used a SimpleTableModel which extends from AbstractTableModel....
i am tryin to do 2 things with JTable : 1st is Paging which works smoothly....

Issue with the above code is :
When i search employee on the basis of firstName the the result is not displayed in table smoothly... it takes some time to refresh on 1st time on subsequent search result is not displayed

I have used Hibernate classes to get all records, which i store in a vector the all search is done on employee records in this Vector

Any help would be greatly appreciated..
12 years ago
why there are
wait(), notify() and notifyAll()
methods declared in Object class


Thanks in advance
12 years ago
Hi...

just did

got this result...



List interface contains public abstract int size() method which is declared abstract...
I want to know which class implements size method.


Thanks and Regards
Shreyas
12 years ago