I have done everything I know. The file is not a ".filetype.filetype". It is in the same folder as the .settings and the other project files. Why is this not working? Full path isn't working either, but strangely, a Scanner is working.
import java.io.FileReader;
public class test {
public static void main(String[] args) {
FileReader testFileReader = new FileReader("hotels.json");
}
}
i am wondering regarding Java: is there a file extension separator?
like *.doc, the "." being the question.
i know there is a line.separator. just would like my app to be portable so i need to know.
thank you.
Hi all,
just wondering if there is a simple way in java to display the contents of say 16x16 array of doubles [0..1] as a greyscale image (ala matlab)? using an unfamiliar matrix library, so I'd like to check that I'm on the right track. don't really care if it is slow or ugly, or if it requires external library - it's just there for a quick look, so as long as it works, I'm fine.
We are using "Bottom Up" approach for building webservices.
We have 10 java classes which we want to expose as a webservice.
How can we create only one WSDL file for these classes?
(java2wsdl utility & its ANT TASK takes only one class as parameter for generating WSDL file.)
Is there any way to have a code where it can be used to open PDF file in Java application but do not side to any platform. I mean using batch file in Windows could do that. Can it be any other way to have platform independent code to open PDF on fly.
In Java, what's generally the most accepted way to organize a class in terms of the order in which declared data members and methods should be listed in the class file, keeping in mind the following and anything else you can think of for each one:
its visibility
whether it's a constructor, method, or member
if it's a method, does it overload, or override other method(s)?
Hey,
Can someone suggest me how to implement a pop-up window in Java Swing. I want the pop-up window to be a modal window (user cannot return to the main window when the pop-up is open).
I tried doing it using JDialog but it allows only one widget for user input to be in it whereas I need multiple widgets. I may be wrong here but this is what I was able to do.
Appreciate your help.
Hi all, I would like to know simple k-means algorithm in java. I want to use k-means only for grouping one dimensional array not multi.
For example,
before grouping the array consists of 2,4,7,5,12,34,18,25
if we want four group then we got
group 1: 2,4,5
group 2: 7,12
group 3: 18,25
group 4: 34
I am planning to write a Java applet for Tower of Hanoi similar to link(
http://www.mazeworks.com/hanoi/index.htm )
Can you suggest how should I start and proceed.
And, btw, does it require multi threading?
And also, major part of my doubt is
to make a disc being clickable and being able to drag and drop the disc on a tower.
detect a tower (if a disc is being dragged using mouse)
What value is hashCode() method is returning in java?. i read that it is an memory reference of an object. when i print hascode value for new Integer(1), its 1. for String(a) - 97. so i confused. is it ascii or what type of value is?
I want from my java code to open word document. But not just to open the document but also to open on exact page or paragraph.
Any ideas or guidelines?
Thanks in advance!
How to create a file in Windows that would have attributes FILE_ATTRIBUTE_TEMPORARY and FILE_FLAG_DELETE_ON_CLOSE set using Java?
I do want my file to be just in-memory file.
I am writing an application program in java. If i need to exit from the application can i use system.exit or should i use some other method, which is good practice. If calling system.exit is not good practice then tell the reason and tell the alternative way to exit from the application.
In python I can construct a HTML string without worrying about escaping special characters like < or " by simply enclosing the string in triple quotes like:
html_string = """
<html>
<body>
<p>My text with "quotes" and whatnot!<p>
</body>
</html>
"""
Is there a similar way to do this in Java?
What are the Java language and standard library design flaws you are aware of? I ask only for flaws that:
cannot be changed or are unlikely to change due to backward compatibility,
are NOT controversial, i.e. most of programmers would agree that "this is a bug not a feature" (for example checked exceptions seem to be controversial language feature, so I wouldn't classify them as "design flaw").
Hi i tried to retrieve all users from the domain using provisioning api & 2-legged OAuth in java program but it returns unknown authorization header........... when i started to search about it i got the scope as https://apps-apis.google.com/a/feeds/user/#readonly. i dont what what #readonly refers please explain it ....
Regards
Sharun
I am trying to display a java table on particular event like, when I click button.
It makes a DB connection, gets data, puts it into the table, and shows the table in new window. But I want to display that table in my main form, i.e. itself button frame.
I have a bunch of JLabels and i would like to trap mouse click events. at the moment i am having to use:
public void mouseClicked(MouseEvent arg0) {
}
public void mouseExited(MouseEvent arg0) {
}
public void mouseEntered(MouseEvent arg0) {
}
public void mousePressed(MouseEvent arg0) {
}
public void mouseReleased(MouseEvent arg0) {
System.out.println("Welcome to Java Programming!");
}
I was wondering if there is a tidier way of doing this instead of having a bunch of events I do not wish trap?
Hi, im connecting to dBase from java with this string:
String url="jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ="+databasePath+";DefaultDir="+databasePath+";DriverId=533;FIL=dBase IV;MaxBufferSize=2048;PageTimeout=5;";
Work fine, but with a SELECT statement i can retrieve only record that are not "deleted".
In dBase database deletet record are only flagged deleted, so i want retrive deleted record too. Is this possibile?
Thank.
Is there any technique available in Java for intercepting messages (method calls) like the method_missing technique in Ruby? This would allow coding decorators and proxies very
easily, like in Ruby:
:Client p:Proxy im:Implementation
------- ---------- -----------------
p.foo() -------> method_missing()
do_something
im.foo() ------------------> do_foo
p.bar() --------> method_missing()
do_something_more
im.bar() -------------------> do_bar
(Note: Proxy only has one method: method_missing())
Hi,
I am getting the following error when deploying an application on JBoss 4.2.1
7:05:59,673 ERROR [Application Name]StandardWrapper.Throwable
java.lang.IllegalStateException: Application was not properly initialized at
startup, could not find Factory: javax.faces.context.FacesContextFactory
I browsed the net and I found many posts which suggested to add an entry in web.xml but that entry was already there. And all the required libraries are there in web-inf.
So any solutions anybody ?
How do java people handle clean up of their apps when the program receives a kill signal?
For instance, there is an application i connect to which wants any third party app ( my app) to send a "finish" command. What is the best say to send that "finish" command if one does a kill -9 on me.