partha phukan

Ranch Hand
+ Follow
since Mar 13, 2011
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by partha phukan

Hi everyone! i need to refresh my JPanel with new data, but i could not able to do it....



Here this is the main class of my project. Above CurrentPanel, HoursPanel, DaysPanel are 3 separate classes where i displayed some JLabels and Graphs and JTables, and the corresponding values for them are taken from the database by executing some queries..... In all the classes i performed all the operations and returned the JPanels. i have used a cardlayout and added the 3 (returned) JPanels in the cardlayout panel( i.e mainPanel) All my queries are running properly everything is fine. But i don't know how to refresh the JLabel, JTable and Graphs values with time. I am maintaining a database table with time as a field. As time changes the queries must take the new time values and displayed in the correspnding places of JLabels, JTable and Graphs.....

I don't know how to use timers. i searched in google and tried to apply myself but no any success.... Please guide me. Please give me some suggestion for this. please.... thank you in advance......
6 years ago
Thank you for your reply. But would you please give me some hint or some suggestion about doing that. Please guide me.... i could not able to find a proper way of doing that. please....
6 years ago
Hi...! i have a problem in refreshing JPanels in cardlayout. I have used cardlayout and i displayed separate informations in different JPanels. Now selecting each JMenuItems from the menuBar displays separate JPanels.

I have used three classes for this.....
1) A class containing the connections and the database queries.....
2) One main class......
3) Separate separate classes for the JPanels (which are in cardlayout) and these JPanels are then added to the main class, which contains the cardlayout........

Again in each JPanels(in cardlayout) there are JLabels and Graphs containing database values. Now my problem is that when i select different menuItems it displays the required JPanels, but it leaves the previous JPanel in that state in which i left.....

Let me explain properly.... For example in one JPanel there is a combobox, having list of Temperature, Rainfall, Wind. Now at first it displays Temperature Graph and if i select Rainfall then it displays Rainfall Graph. Working fine.... Now if i select another JMenuItem then it takes me to the respective JPanel, but it leaves the JPanel in that state where i left i.e when i again select JMenuItem (for the JPanel) then i found the JPanel with the Rainfall Graph but i need the JPanel with the Temperature Graph..... i.e the JPanels must got refreshed at each switching (of JPanels), by selecting JMenuItem

Probably i could explain you properly..... I have tried to use swing timers, but still not any progress........ Please suggest me..... please guide me........ Please give some valuabe information...... Any help will highly be appreciated.... Thanks
6 years ago
Yaaa! i did it. i used JSON and with the help of it i can able to perform the action.... Thanks for your guidance........
6 years ago
Sorry to say that but i could not able to use mouse listener for open street map. i tried a lot. If possible please give me an example explaining this.......... i cannot find any way.... if you can please come forward and take me to the right track..... please guide me......please....
6 years ago
Sir, i don't know the proper code thats why i have not shown previously. Here it is.....

i tried the code.

Now i found the error in getInstance method giving errors---
Bound mismatch: The generic method getInstance(Class<T>) of type Application is not applicable for the arguments (Class<MapPanel>). The inferred type MapPanel is not a valid substitute for the bounded parameter <T extends Application>

and also in getContext() giving errors---
The method getContext() is undefined for the type MapPanel


Now i don't know how to do. please guide me as i don't know much about it. the second error i know that it is due to not defining the method getContext() in MapPanel. But i don't know what to put in that method.......... please show me a way. i am completely lost and cannot find any way to come out. please help me..... as i left only 10days to complete my work. i am searching in google but in vain. still trying.
6 years ago


I have used seperate classes. i returned the JPanel(mapContainer) and used in another JPanel(panel) class which contains a JPanel(labelPanel) with JLabels, using GridBagLayout. Now i need to use mouse listener from labelPanel, but i could not able to do it. please guide me......
6 years ago
Hello...! i have a problem and i could not able to overcome it. I have two JPanels- one where some JLabels are placed and in another open street map is placed. Now i need to perform mouse listener for the JLables. If i clicked a JLabel then it must take me to that particular location of open street map. i am trying for more than a week but still cannot able to find any solution. please give me some suggestion.i have found one link but it does not work for me.....

http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html

If anyone come forward and give some suggestion then i would be very thankful to him/her. Please share your knowledge with me.......

Thanks.
6 years ago
Thank you for your reply. Actually i need to show some popup window in some particular locations of the map based according to latitude and longitude and in that popup window i need to show some weather parameters like temperature, rainfall. Please guide me i could not able to find any way to proceed further.
6 years ago
hi everyone....! sorry to say but i need some help from you. If you guide me then i will be very helpful to you. Actually i am stuck at the point of displaying pop up window for open street map. I have been searching in the google but in vain.i am trying for more than a week. Still trying. If you can give me some useful link or suggestion then i would be very grateful to you. I am using java swing and i displayed open street map in a JPanel by going through the links and taking help....

http://today.java.net/pub/a/today/2007/11/13/mapping-mashups-with-jxmapviewer.html

http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html

Now i need to use pop up window. Any help from you will highly be appreciated...... Thanks in advance....

6 years ago
Sorry for my reply and question. Thanks for your guidance. i will try my best and will somehow manage. you have given me your valuable time and guided to this much. Ok. thank you once again. hope i can able to do it.
7 years ago
Thank you once again for your guidance. Actually i am using java eclipse. Do i have to include something in my class path as i did for setting class path for jdk.

I have included all the jar files which is in dist folder of MapApp in a folder of my java project in eclipse. Again do i need to do something different.

Thank you.
7 years ago
Thank you i get some idea. But please guide me, i am facing problem in using "import org.jdesktop.application.Action" i mean to say that every org.jdesktop line is showing errors. i think the required jar file is not included in my project. i cannot able to include it. will you please again guide me. Thanks a lot.
7 years ago
First i extracted the zip file using WinRAR, after extracting i tried to run the master 'JNLP file ' first to observe how it performs. When i tried t run it shows me error "Unable to launch the application".

When i see the datails it shows two exceptions.

1. Exception

com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/F:/New Folder/MapApp/MapApp/${jnlp.codebase}/launch.jnlp
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

2. Wrapped Exception
java.io.FileNotFoundException: F:\New Folder\MapApp\MapApp\${jnlp.codebase}\launch.jnlp (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
7 years ago
but i tried and it is giving me error that "unable to launch the application".
7 years ago