Hello. My professor directed me here to see if I could get some questions answered. I need help with Java and the program I am working on.
My program is made up of multiple classes, but some share the same panels. Is there a way I can put the panel in its own class and then call that panel to the other classes that use it? I tried creating a class with all the variables and then making a method that returns the JPanel, however the compiler won't allow it. Are there any suggestions?
Is it possible to write to an Excel file with JDBC/OBDC? I figured out how to read from an Excel sheet, but I do not know how to make it write.
Once everything is saved to said Excel sheet, am I able to search through the values to look for a specific value? There is a section where I need to be able to search through the data and return what I'm asking for. This is one of the most crucial features to the program.
Finally, when I save the entire thing as an executable jar file, the images are not include. How do I get it to display the image? This is the code I currently have:
but the image is not displayed when I turn it into a .jar file. It does show when I use Eclipse, however.
Thank you very much.
posted 9 years ago
The code for my first question is this:
where the entryPanel and all of its variables are declared and instantiated above in the class and constructor.
Sorry for the uninformative subject line, I just didn't know what to call it since there were several different topics.
I'm trying to not use any copyrighted work because I plan on protecting this program once I finish. I don't know if I'd be allowed to do so if I used JExcel or the POI. I am trying to learn XML so I can save everything as an xml and then have Excel read it.
The Class.getResource is not working. I keep getting a message saying that I cannot make a static reference to a non static method getResource(String) from the type Class.
I've tried to make a url as well, but there is something that I'm missing.
posted 9 years ago
You would have to read the terms and conditions of use of POI to see whether you can incorporate it in your own product. It might be laborious and error-prone to write your own when there is a well-tested product already available, however.