I'm getting InputStream of attached file by web service.
When the user attaches an empty file,
the input stream is not empty, but contains the header of the file (taht can be image, video, zip and others).
When I read inputStream.available() I get 11 - the size of the header.
I believe that for every type of file there is different heade...
I need the ability to have a blinking (red, maybe more colors) background for rows in a TableViewer/TreeViewer. What are the best options?
There may be more than one row blinking, the blinking MUST be synchron and I need two blinking modes, fast and slow.
...
i've made a menu bar with netbeans.
in the menubar i've got
file >exit
Help >Help F1
>about
the problem is i don't know how to link up either help or about to another frame that has everything i want the user to see.
can someone please tell me how to go to a new frame once eiher help or about is clicked?
thanks
...
I have added to a JTextField a JPopupMenu. Unfortunatelly, when i change the focus from JTextField, or when i "minimize" the window, the JPopupMenu still is visible.
I need to make it invisible if JTextField is loosing the focus.
How can i do this?
...
What is real difference between Class and Structure when you are dealing with Object Oriented Programming. This question is asked many times during my interviews for SE.
Some people says that there is only one difference:
Structure members are public by default and Class members are private by default.
Some says there are many differen...
Hi there,
I'm using displaytag to build tables with data from my db. This works well if the requested list isn't that big but if the list size grows over 2500 entries, fetching the result list takes very long (more than 5 min.). I was wondering if this behavior is normal.
How you handle big list / queries which return big results?
...
I was about to pick up some Java web programming since not having touched Java for a couple of years. I picked up an fairly old O'Reilly book that was sitting on my bookshelf (Java Server Pages 3rd Edition, covers JSP 2.0 & JSTL 1.1) and started skimming the pages. I went over to download the latest JSTL libraries and noticed that they a...
Hello,
In the answers here lately, I found some different habits (or flavours). So I wonder when and why is the use of Java's System.arraycopy(...) preferable to something like Collection.addAll(...)? When not?
Edit: It boils down to arrays vs. collections. Thanks so far. But which can be handled more effeciently by the computer or is....
for (String fruit : list)
{
if("banane".equals(fruit))
list.remove(fruit);
System.out.println(fruit);
}
Here a loop with remove instruction.
At execution time, I get some ConcurrentModificationException, below the console output:
Exception in thread "main" java.util.ConcurrentModificationExcepti...
I have to print the whole sourcecode of a java-project.
The final version should look like: Eclipse: File -> Print.
But with this function you can only print one file at once.
Is there a way to print (or create a pdf/rtf of) the whole project (all *.java, *.xml, ... files) with one command?
Im using eclipse galileo on windows xp sp3
...
I would like to do something like this:
private ArrayList<String[]> addresses = new ArrayList<String[3]>();
...this does not seem to work. Whats the easiest way of storing multiple addresses with 3 fields per address in an array without creating a separate class for it?
...
hi.
in netbeans 6.8 how do you insert an image and change the size of it?
i have tried to insert an image into a label. this allows me to change the size of the label but not the size of the image.
thanks
...
When given an Exception object in Java, is there any way to get (or infer) the instances involved in the stack trace of this exception? I know that StackTraceElement contains information about the classes involved, but what about the actual instances?
In case you're wondering, I'd like to use this in a Thread.UncaughtExceptionHandler th...
Hi,
I'm doing a simple forum with a series of Servlets that each represent a home, topic, postedit, login and userlist page. On some of these pages there is a link that appears when a user isn't logged in.
What I'd like to achieve is to trigger a redirection (using forward() on a RequestDispatcher) after a login so the browser goes bac...
i have a method that returns a map defined as:
public Map<String, ?> getData();
the actual implementation of this method is not clear to me, but:
when i try to do:
obj.getData().put("key","value")
I get following compile time error message:
The method put(String, capture#9-of ?)
in the type Map
is not applicable for the ar...
Hi,
I've got some code that calls..
x = getClass().getClassLoader();
This returns null though.
When I start the same code not from Eclipse, but the command line, it returns a classloader.
I can hack the code to do this...
if (getClass().getClassLoader() == null)
{
x = ClassLoader.getSystemClassLoader().getSystemResourceAsStream( ...
Have you ever heard or had such experience? Are there any known issues in such a scenario, that does not exist in .Net client scenario. I guess development in such a scenario will not be as smooth as in .Net client. Share your experience please.
...
I have been trying with limited success to code a JSF application. In one section of the application, I need users to select from a select menu which displays a list of selectable status values. The Status class (presented below), which is used to populate the List that is displayed in the select menu, is a simple class made up of two St...
how do i close a frame yet open a new frame?
i have a frame, (help)
when i click on my menu item
i want to open (mainForm)
exit from help.
new mainForm().setVisible(true);
System.exit(0);
i know this closes the whole program however how do i get it to only close the current frame
thanks
...
All,
I'm trying to find out, unambiguously, what method (GET or POST) Flash/AS2 uses with XML.sendAndLoad.
Here's what the help/docs (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs%5FParts&file=00002340.html) say about the function
Encodes the specified XML object into
an XML d...