Hello all,
I'm looking for the most basic description of how to draw text within a JPanel. I know there are a billion tutorials out there but none of them are clicking with me and I have some specific questions which may help others who are confused. As a setup (a testing app) I have a single class which has a JLabel, a JTextField, a J...
I'm writing a Java program that searches for and outputs cycles in a graph. I am using an adjacency list for storing my graph, with the lists stored as LinkedLists. My program takes an input formatted with the first line as the number of nodes in the graph and each subsequent line 2 nodes that form an edge e.g.:
3
1 2
2 3
3 1
My proble...
It sounds like a very silly question but can anyone explain me about Input stream and output stream.
I remain confused about when do we need input stream and when we need output stream?
An explanation with some code snippet will be great.
I just need to figure out their difference and usage.
...
I'm supporting a large system written in C++ and we now have a requirement for our application to talk with a third party system which only provides a JTAPI interface. It would appear that I am stuck writing a JTAPI proxy in Java that talks JTAPI on one side and some more language-neutral API on the other. However, this feels like it sho...
Hi,
For the criterias below, what a technology stack would fit best?
Cross-platform (Linux/Windows).
Ability to run as a service (daemon).
Powerful object-oriented data access (O/R-mapping).
Multiple databases support (MsSql, Oracle, MySQl, SqlLite, Postgress).
Web application can be tested (Unit and Integration testing).
Reasonable o...
I want to know why exactly static variables in C, C++ and Java are initialized by zero by default? And why this is not true for local variables?
...
Can anyone explain the science behind the sampling functionality of visualvm ?
I would have thought that collecting the amount of CPU spent on each particular method would require instrumenting the application to be profiled, but it doesnt look like visualvm is doing any kind of instrumenting, so I'm curious to know how it's done...
...
I would like to implement a template which contains an array of the template Type. Is there a way to do something similar to what I have outlined in my sample code? The problem is in the line where this.foo is assigned a new array of the template type.
class Classname<T>
{
T[] foo
Classname()
{
this.foo=new T[128];
}
}
...
I have built a simple flex application (using BlazeDS) which displays "Person" details by invoking a java service using flex remoting.
So, my Person class looks something like this:
class Person {
public int age;
public String name;
}
As a java developer, here is my understanding:
When I run the front flex app in my webapp, an RPC c...
Hi,
I just registered an OnLongClickListener on my my MapView on an Android app I'm currently writing. For some reason however the onLongClick event doesn't fire.
Here's what I've written so far:
public class FriendMapActivity extends MapActivity implements OnLongClickListener {
private static final int CENTER_MAP = Menu.FIRST;
...
hi, I'm getting java.lang.NullPointerException at while ((len = in.read(buf , 0 , buf.length)) >= 0) in following method:
public void copy(String src, File dst) throws IOException {
InputStream in = getClass().getResourceAsStream(src);
OutputStream out = new FileOutputStream(dst);
byte[] buf = new byte[1012];
...
Hi all,
I have a Jtable with 6 columns where i have Check boxes in the 6th Column.I am outing the text in to JTable by using the setValueAt() and getValueAt() methods.For the same Jtable I have Find,Replace and Replace All Controls to find,replace and replace all the text i the jtable.The Particular cel will be focussed for Find text.Pa...
I have a MSSQL Database, and I have a stored procedure for any possible query, most of them just return a row of data with 3 columns or just execute an INSERT
How in java to connect to the DB and execute a stored procedure, and retrieve some data ?
...
I am getting the error "java.lang.IllegalStateExcepton: Failed to load Application Context" when I am trying to run my unit test from within Eclipse.
The Unit Test itself seems very simple:
package com.mycompany.interactive.cs.isales.ispr.ws.productupgrade;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWit...
I am a crazy Java beginner, FYI.
I want to compile a program (actually to answer an SO question) that uses the org.json package in these files:
http://json.org/java/
I created a basic Java application in NetBeans, but how do I get these to be class files that my main class recognizes, and that they recognize each other. Do I need to j...
Is it possible to convert a .class file to .java file. If yes then how? What about the correctness of the code extracted from this option?
...
Hi! I have problem with h:datatable tag in JSF. I don't know, why my datatable is not showing on my page. Some advices?
Here is my code:
<h:dataTable rows="2" var="deb" value="#{debCredTab.rows}">
<h:column>
<f:facet name="header">
Debet
</...
Hi experts,
I am looking for a peace of java-code that is able to open a .mdi file (microsoft document imaging) and save it as a tiff or pdf-file. I googled a few hours but did not find any.
All I know now is that .mdi is derived from tiff, but I could not find an exact format description anyway.
Any linux-tool, that could do the conver...
Hi all,
I'm very new to Hadoop and I'm currently trying to join two sources of data where the key is an interval (say [date-begin/date-end]). For example:
input1:
20091001-20091002 A
20091011-20091104 B
20080111-20091103 C
(...)
input2:
20090902-20091003 D
20081015-20091204 E
20040011-20050101 F
(...)
I'd like to...
Hi, everybody!
I have an excel template with images... When I simply populate it with data everything works fine. But I need programmaticly to add comments to cells sometimes, and the only way I found is to use HSSFPatriarch. But when I call HSSFSheet.getDrawingPatriarch() all images on sheet disappear... So the question is:
1. Is there...