Hmmmm...a bootstrap JVM. Very interesting and unexplored concept. It would be possible, although difficult, to write a JVM/OS launcher hybrid that could be launced from the BIOS and a corresponding Java OS. I just dunno what the point would be...w/ Java you're looking for platform...
Like stefanwagner said, it's tough to offer advice here without knowing your code's intention.
If you're simply using the ArrayList to hold any type of Gun, then why not extract all common behavior into an inteface, then use generics to type your ArrayList ie
public interface Gun
{...
Hi all
Rather new to using SSL though not so much to Java itself.
I am attempting to connect to an outside vendor's Web Service via SSL and am getting the error "javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake"
Here are some snippets of my code:
public...
This is quick, dirty and untested, but something along these lines:
public class MyDateEntryFilter{
public void validateEntry(String dateEntry) throws FormatException{
//assuming the only accepted format is "MM/dd/YYYY"
try{
validateMonth(dateEntry);
//day .. year...
I may not be 100% correct in this (who ever is?) but I believe the best practice in a case like this is to:
1. Declare all variables at the top of the scope in which they are to be used.
For instance, a class level variable would be declared as follows:
public class Connector{
private...
Personally, I would stop execution when I got to the parsing exception. It almost seems as if you are trying to do the same job twice. The parse exception is telling you that you have entered an invalid date. Since the initial value you set for parseDate is null, you should not attempt to use...
I don't think it is throwing an error...it is parsing your date as the 15th month of the year 2005, which if you think about it is actuall March of 2006. All your subsequent calculations are being performed on the newly parsed date of March 30, 2006.
I would not advise you try to correct...
You said you are calling repaint on the Frame. I would just call repaint on whatever component you are drawing on (JPanel?). Also, if you are not using Java Swing, make sure you utilize double buffering to avoid the 'flickering'. If you are unsure, double buffering is the practice of drawing...
I would load the ComboBox with your own Objects, not String values.
For example:
public class Mode
{
int value;
String name;
//..getters and setters
public Mode()
{
//things you need for initialization here
}
public String toString()
{
//return the String you'd like to...
You didn't say how much total memory your machine has, but remember you have to share the available memory with the OS, DLL's, etc. so you will not be able to allocate all the machines memory to the JVM.
This thread may be of help.
Rich
If you're willing to use Swing rather than AWT, I offer you the following:
JTextField fld = new JTextField();
fld.setHorizontalAlignment(JTextField.CENTER);
Hope this helps!
Rich
Hi porkymin, welcome to the world of Java!
It would be helpful to know what background you are coming from. Are you currently a programmer? If so, what technologies and theories do you currently know and practice? Also, why is it you want to learn Java? What are your goals for it?
Rich
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.