| Hiding default console in Windows |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- 1
- JavaHelp and root nodehi,
Simplifying i have a java help set as this
ROOT -> C
-> B -> b1
-> b2
-> b3
->C
I can set B as current visualized node with these instructions:
helpBroker =(DefaultHelpBroker)coreHelpSet.createHelpBroker();
helpBroker.setCurrentID(B);
my problem is that i'd like to hide the other nodes setting B as tree
root node so that i could only see B and its children b1,b2,b3.
This is because entire help set is recovered from a big manual
describing a lot of applications and i'd like to show only one referred
by node B avoiding to show others that couldn't be installed.
Can you help me?
thanks
- 2
- Reflection and access to type parameter?Given the SSCCE below, the need to pass A.class and B.class in
lines 25 and 25 seems redundant. However, I can find nothing in
the language that would let that be done in the constructor,
between lines 18 and 19. The obvious would be
Class<T> x = T.class;
but that of course does not work. Is there any bridge at all
between reflection and generics? I suspect the answer is no
and the code below is the best that can be done, but I'm
not sure.
1 import java.lang.reflect.Method;
2 public class TestEnums
3 {
4 public static enum A
5 {
6 V1,
7 V2;
8 }
9 public static enum B
10 {
11 X1,
12 X2,
13 X3;
14 }
15 public static class C<T extends Enum<?>>
16 {
17 public C(Class<T> x) throws Exception
18 {
19 T[] eVal = x.getEnumConstants();
20 for (Enum<?> v : eVal) System.out.println(v.toString());
21 }
22 }
23 public static void main(String[] args) throws Exception
24 {
25 C<A> ca = new C<A>(A.class);
26 C<B> cb = new C<B>(B.class);
27 }
28 }
- 2
- how to mail a form in JSPhi this is ravin. i m a last year IT student and i am doing my project
at a govt. organization. i have to do one thing in my project that:
> there is a feedback form which is to be filled by any user.
> it is having four fields.
1) name
2) tel.no
3) e-mail address
4) comments
> i simply have to mail this fields to the org.'s mail address when user hits submit button. there is nothing to do with this fields.
please send releated help as early as possible.
- 4
- Clients are bad ?Hello John Bailo , You say :
" Open source is just about old style client software
catching of to the Web economy "
You obviously don't believe that yourself ,
otherwise you'd be using Google ... Not Moz .
- 5
- JTable(A few more queries )I had a couple of more queries -
1) how to prevent swapping of the columns as in, by default the columns
in the JTable are not fixed in terms of their placement. They can be
very well swapped with one another. I want to prevent this.
2) Also after feeding the JTable with the data in database, i want to
be keep one row always empty so that a row can be inserted. It's like
we have in MS-Access.
hope i was clear in explaining the query properly.
Thanx,
Ankur
- 5
- Programatically deducing VARCHAR2 length?Hi,
I'm using WebLogic 5.1 sp12 and Oracle 8.1.7 with JDBC 1.2 drivers.
I was wondering, if I know that a column is a vARCHAR2 column, how
could i deduce the maximum length of that column, short of repeatedly
inserting larger and larger strings until I genertae an exception. I
know with SQL*Plus I can describe the table and find out lengths that
way, but I was hoping for a more general automated method.
Thanks for any help anyone can provide - Dave
- 7
- Java Training QuestionI am an unemployed web developer with php, perl, and asp programming
experience and in order to be able to widen my job search I am considering
getting some formal training in Java. I am looking for training
recommendations in order to be able to do Java web development. Also will
this training be appealing to prospective employers or just a waste of my
time and money. Any feedback I get will be greatly appreciated.
- 7
- 7
- EMPTY_SET.iterator() and generics
In the old days, before generics, I wrote
private SortedSet onhand;
Iterator getInventoryIterator() {
return (onhand == null ? Collections.EMPTY_SET ? onhand)
.iterator();
}
... the idea being to create the SortedSet only if there are
actually some Inventory objects to store in it, and to return
a suitable Iterator whether or not the SortedSet exists.
Now, in an effort to leave prehistory behind me and adopt
generics with all their benefits, I change the SortedSet to a
SortedSet<Inventory> and change the return type of the method
to Iterator<Inventory> -- but how do I rewrite the guts of the
method to get the compiler to understand that all is well? The
problem seems to be that Collections.EMPTY_SET.iterator() returns
an Iterator<Object>, and the compiler complains when I try to
return this in place of the desired Iterator<Inventory>. I've
tried a few variations, but have only succeeded in moving the
warning message around, not in eliminating it:
return (onhand == null
? (Set<Inventory>)Collections.EMPTY_SET : onhand)
.iterator();
return (Iterator<Inventory>)
(onhand == null ? Collections.EMPTY_SET ? onhand)
.iterator();
This seems like a lot of trouble to take over the empty set,
but there ought to be *some* clean way to do it. Ideas?
--
Eric Sosman
email***@***.com
- 13
- Printing EPS (embedded postscript) from Java.
Hello all,
I need to print .eps (also called .epsf, .epi, .epsi) from inside a
java program. My target platforms are windows and mac-- although
windows is first.
The new 1.4 printing API has aupport for printing normal postscript
but does not have .eps support.
I've been looking around the internet to see what solutions people
have come up with and unfortonately I didn't get what I would call a
solid answer by doing this....
I looked at the source of two open source programs the support .eps.
They both have origianal source but esstenially did it almost exactly
the same way. They took the .ps file the the standard Java classes
generated and just stuck an .eps header on it. They then stick the .ps
inside a box as required. They then searched the .ps file for commands
that are illegal in the .eps and if they are there they just die.
I've got some serious problems with this:
(1) It assumes that the Sun classes are going to generate a .ps that
is easily converted to an eps. Maybe they do now but what about future
versions of Java?
(2) It makes big assumptions about future .ps and .eps formats.
(3) It stinks of just being a hack. Does anyone really know this is
going to work all the time and on all platforms?
Does anyone have any experience with making .eps from Java that has
any sugestions? I want to translate my Garphics2D objects to .eps. I
want the .eps to be accepted by major publishing programs on windows and
mac.
Thanks
Glen Pepicelli,
http://www.glenp.net
(reply to group)
- 16
- looking for a Java decompilerHello!
Is there a good byte-code de-compiler in the ports? It does not
need to be fancy/GUI -- just a straghtforward .class->.java utility.
Thanks for any pointers. Thanks!
-mi
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 16
- Asking help for a java io problemHello, guys! I have a problem running the following code with eclipse
showing that:
java.io.IOException: Stream closed
at sun.nio.cs.StreamDecoder.ensureOpen(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at HtmlFileParser.parseHtmlDoc(HtmlFileParser.java:32)
at HtmlFileParser.main(HtmlFileParser.java:52)
//code here:
try{
FileInputStream fin = new FileInputStream("test.html");
InputStreamReader fr = new InputStreamReader(fin);
for(i=0; i<2048; i++) buf[i] = '0';
fr.read(buf, 0, 2048); //problem here (line 32)
FileWriter fw = new FileWriter("bufWriteTest.txt");
fw.write(buf);
fw.flush();
}
catch(FileNotFoundException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}
There are no syntax erro in the above code, it just dosen't work,
please help me finding out what the problem is, thank you.
- 16
- Riddle me thisOn Mon, 07 Nov 2005 11:35:27 GMT, "Sharp Tool"
<email***@***.com> wrote, quoted or indirectly quoted someone
who said :
>All these distribution dont include negative numbers?
A normal is clustered about a mean, nominally 0, with symmetric tails
left and right.
Poisson is a distribution of positive numbers.
Just what do these numbers measure?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 16
- Problem in connecting to a proxyHi,
i need to see if a user enters the correct username/password to
authenticate to a proxy. My problem is... through the following code,
i am
able to connect to a proxy with even invalid username/passwords.
Suppose
if the valid username and password to a proxy is test/test , i am able
to connect to the proxy using x/x . the response code returned is
always 200. Please advice..
################################
public static boolean isValidProxyAccount(String proxyServer,String
proxyPort,String proxyLogin,String proxyPassword) throws IOException
{
String go_url = new String ("http://www.google.com/");
boolean VALID_STATUS = true;
try{
URL url = new URL(go_url);
System.getProperties().put("proxySet",
"true");
System.getProperties().put("http.proxyHost", proxyServer);
System.getProperties().put("http.proxyPort", proxyPort);
HttpURLConnection con = (HttpURLConnection)
url.openConnection();
Base64Encoder b1 = new
Base64Encoder(proxyLogin+":"+proxyPassword);
con.setAllowUserInteraction(true);
String enStrProxy = "Basic "+ b1.processString();
con.setRequestProperty("Proxy-Authorization", enStrProxy);
int code = con.getResponseCode();
String retMsg = con.getResponseMessage();
System.out.println("code::"+code);
System.out.println("retMsg::"+retMsg);
System.getProperties().put("proxySet", "false");
System.getProperties().remove("http.proxyHost");
System.getProperties().remove("http.proxyPort");
con.disconnect();
if (code != 200){
VALID_STATUS = false;
throw new IOException("Failed to connect to CCO: "+retMsg);
}
}catch (Exception ex){
System.out.println(ex.getMessage());
throw new IOException(ex.getMessage());
}//catch
return VALID_STATUS;
}
|
| Author |
Message |
Randolf Richardson

|
Posted: 2007-1-20 1:38:00 |
Top |
java-programmer, Hiding default console in Windows
Hello. Is it possible to hide the default console window in MS-Windows
in Java? If so, how?
When writing a Swing/JFC application in Java, it would be really nice to
somehow hide the DOS window that appears.
Thanks in advance.
--
Randolf Richardson - kingpin+email***@***.com
The Lumber Cartel, local 42 (Canadian branch)
http://www.lumbercartel.ca/
|
| |
|
| |
 |
Thomas Kellerer

|
Posted: 2007-1-20 1:43:00 |
Top |
java-programmer >> Hiding default console in Windows
On 19.01.2007 18:38 Randolf Richardson wrote:
> Hello. Is it possible to hide the default console window in
> MS-Windows in Java? If so, how?
>
> When writing a Swing/JFC application in Java, it would be really
> nice to somehow hide the DOS window that appears.
>
> Thanks in advance.
>
Use javaw instead of java
And search google ;)
There are a lot of hints regarding this
|
| |
|
| |
 |
lee

|
Posted: 2007-1-20 5:56:00 |
Top |
java-programmer >> Hiding default console in Windows
In article <email***@***.com>, "Randolf Richardson" <kingpin+email***@***.com> wrote:
> Hello. Is it possible to hide the default console window in MS-Windows
>
>in Java? If so, how?
>
> When writing a Swing/JFC application in Java, it would be really nice
> to
>somehow hide the DOS window that appears.
>
> Thanks in advance.
>
When you package your application in an executable JAR file, and double-click
it to start the program, Windows will start the program with javaw.exe instead
of java.exe. javaw does not show a console screen.
Lee Weiner
lee AT leeweiner DOT org
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2007-1-20 9:45:00 |
Top |
java-programmer >> Hiding default console in Windows
Lee Weiner wrote:
....
> When you package your application in an executable ...
(by adding a manifest file identifying the main class)
>...JAR file, and double-click
> it to start the program, Windows will start the program with javaw.exe instead
> of java.exe. javaw does not show a console screen.
Another way to go is..
- package app. in any old jar. (no manifest needed)
- (sign the jar - if the project can not work in a sandbox) and
- launch using web start.
Web start (JWS) gives the user even better options (launch
via. desktop icon or menu item) and provides for automatic
updates, amongst other things.
Perhaps it is a little beyond your needs for the moment,
but it is worth considering for future projects.
Andrew T.
|
| |
|
| |
 |
Randolf Richardson

|
Posted: 2007-1-20 15:13:00 |
Top |
java-programmer >> Hiding default console in Windows
On Fri, 19 Jan 2007 09:43:11 -0800, Thomas Kellerer
<email***@***.com> wrote:
> On 19.01.2007 18:38 Randolf Richardson wrote:
>> Hello. Is it possible to hide the default console window in
>> MS-Windows in Java? If so, how?
>> When writing a Swing/JFC application in Java, it would be really
>> nice to somehow hide the DOS window that appears.
>> Thanks in advance.
>>
> Use javaw instead of java
Thanks to you and Lee for this suggestion.
> And search google ;)
I did that, which is why I asked here.
> There are a lot of hints regarding this
I'll do some experimentation as well. Thanks.
--
Randolf Richardson - kingpin+email***@***.com
The Lumber Cartel, local 42 (Canadian branch)
http://www.lumbercartel.ca/
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- GUI program locking up...I'm using Netbeans 5.0 beta for an IDE, with swing components. The
situation is something like this:
The program is a board game - the user chooses a building from a panel,
and then is supposed to get a message to choose what resource to pay
for it with. Here's a trace of the code:
Game (main object):
....
board[i].activate():
Game.game.setPlayer(worker);
Game.game.playerMessage("Choose a wooden building
from the building panel.");
Game.game.waitForBuild(type) :
built = false;
state = type + Game.BuildWood -
1;
mainPanel.buildings.getBP().setSelectedIndex(type-1);
while(!built)
{ Thread.yield(); }
No problems yet. This works fine, unless a building that needs to call
chooseResource is selected.
So, the user clicks one of these buildings, which activates the
following code, which is where the freeze occurs:
String r = Game.game.chooseResource():
state = Game.chooseResource;
resource = "";
while(resource.length()==0)
Thread.yield();
return resource;
Now chooseResource does work in any other context - resource gets set
by a mouseClicked event handler in a panel out there. But at this
point, the GUI stops responding. The playerMessage never gets printed,
and the click event never gets triggered. I did some investigating,
printing out numbers inside the two inmost loops, and the
chooseResource loop is continually running. I know the code's ugly,
but even so, the cause of this behavior is beyond me. Any suggestions
would be greatly appreciated!
- 2
- jbuilder 2005 backward compatabilityHi
I have a project that created by jbuilder X, in the "design" panel,
everything work great, but when i use jbuilder 2005 to open it, it
only display gray. Do you know why?
thanks
from Peter (email***@***.com)
- 3
- ports/71078: Update port: java/eclipse-pmd upgrade to supportSynopsis: Update port: java/eclipse-pmd upgrade to support eclipse3
State-Changed-From-To: open->feedback
State-Changed-By: linimon
State-Changed-When: Thu Sep 2 23:17:52 GMT 2004
State-Changed-Why:
Please submit port updates in diff -u format as versus the current
port. This makes it much easier for ports committers to understand
what is being changed. Thanks.
http://www.freebsd.org/cgi/query-pr.cgi?pr=71078
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 4
- cmr one-to-many unidirectional - jbossHas anybody been able to get a CMR one to many unidirectional
relationship working with jboss? I'm trying to get it to work but keep
getting "foreign key constraint not allowed for this type of data
store".
The relationship is simple, I have two entity beans, person and
company and I want to have one to many unidirectional relationship
between these two beans. A person has one company, but a company has
many persons.
I want to have a company_id field in my person table that refers to
the id field in my company table. Maybe I'm missing something or doing
this wrong?
If somebody could post a working example of one to many unidirectional
I'd be mighty grateful. I'm trying to use the foreign-key-mapping
rather than relation-table, can you do this with foreign-key-mapping?
Here's what I have:
/**
* @return the company the person belongs to
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="COMPANY_ID"
* sql-type="integer"
* jdbc-type="integer"
*
* @ejb.interface-method
*
* @ejb.relation
* name="Person-Company"
* role-name="Person-belongs-to-Company"
* target-ejb="Company"
* target-role-name="Company-has-many-Persons"
* target-multiple="yes"
*
* @jboss.relation
* fk-constraint="true"
* fk-column="COMPANY_ID"
* related-pk-field="id"
*
*/
public abstract CompanyLocal getCompany();
- 5
- Read contents of a web pageI need to read the entire contents of any webpage, and return it as a
String. The other part of my assignment was to read a file and return its
contents. I did that with the following code:
private String filename;
private String contents;
public TextFileReader(String aFileName){
filename = aFileName;
}
public String readText() throws IOException{
String lineSep = System.getProperty("line.separator");
BufferedReader input = new BufferedReader(new
FileReader(filename));
String nextLine = " ";
StringBuffer contents = new StringBuffer();
while((nextLine = input.readLine()) != null){
contents.append(nextLine);
contents.append(lineSep);
}
return contents.toString();
}
----------
So, what do I have to change to be able to read webpages?
- 6
- how to set row height at runtime in a JTableHi
i am trying to set rowheight of row in a JTable using
setRowHeight(row,rowheight)
it is not affecting on Table.but if i use setRowheight(rowheight) it
applying
entire table ,please help me to solve this problem
after setRowHeight(row,rowheight), i am calling firechanged() method
also ,i t will not affecting please hemp me
- 7
- JacOrb Multihomed serverHi everybody,
we have problems running a corba-server on a multi-homed Win2k-Box.
The machine has two network-cards. JacOrb is using the wrong IPAddress
for IOR's.
I tried the property OAIAddr. Only setting the property to 127.0.0.1
and running server and client on the same machine was successful.
Using the real address failed.
Does anyone have an advise for me ?
Thanks in advance
Ruediger
- 8
- Identify unused methods??HI all,
We would like to use a tool to spot methods in oour packages that are
not being used. We have the entire source set under Eclipse, so a
plugin would be best. We do not want anything too complex or a graph,
or statistics, just a simple report that indicates what methods are not
used. Does anyone know of such a thing?
I did look in the usual places; I found code formatters, style
analyzers, code coverage tools...but no tool that does what I've
outlined.
Thanks,
Alejandrina
- 9
- Multiple Exception Definitions in One FileIn Ada I could have a package that consisted of a group of exception
declarations, and any compilation unit that "withed" in that package
could use them. On the other hand if I want to use my own customized
exceptions in Java, it looks like I have to declare each one individu-
ally in its own file. Is this really what I have to do, or is there a
way to declare a bunch of exceptions in one file so that I can use
them elsewhere?
---Kevin Simonson
"You'll never get to heaven, or even to LA,
if you don't believe there's a way."
from _Why Not_
- 10
- ?s about Process ClassI have a DOS program I am trying to supply input to using Java.
Reading from The Java Class Libraries, 2nd Ed. java.lang.Process class -
the material presented seems to imply that I will be able to do
this.
The program most definately uses just stdio... (in) being the keyboard and
(out) being the consol.
Well I can't get it to work and being the presistant bugger that i am I have
switch tactics so I can more up the learning curve.
I have resorted to just trying to display the output of mem.exe.
here is the source ::: test.java
import java.io.*;
import java.lang.*;
public class test
{ public static void main(String[] args)
{
int ch;
int status;
try
{
Process process = Runtime.getRuntime().exec("mem.exe");
InputStream in = process.getInputStream();
BufferedInputStream buf = new BufferedInputStream(in);
//try
//{
//status = process.waitFor();
//}
//catch (InterruptedException e) {status = -1;}
try
{
while((ch = buf.read()) != -1)
{
System.out.print((char)ch);
}
}
catch (IOException e) {System.out.println(e);}
//in.close();
//buf.close();
//process.destroy();
//Runtime.getRuntime().gc();
//Runtime.getRuntime().exit(-1);
//System.out.print('\n');
}
catch (IOException e) {System.out.println(e);}
}
}
It works the first time I run the class file with java test.
However, the next attempt hangs and requires a system restart inorder to get
the code to display the results.
The commented code in test.java are my attempts to do various things to
clean up this issue of not displaying the results.
Does anyone have a clue or suggestion...
thanks,
publius36
- 11
- DES in javaHi,
I need to write a method in Java for
encrypt a String with DES.
the interface is:
public String encrypt(String nameofthestringtoencript);
the return String have to be DES(nameofthestringtoencript)
What is the procedure to follow and the java methods
to do it?
Thanks in advance.
- 12
- learning J2EEHi all,
I have been a java developer for around 5 years, and I think it is time to
move into the J2EE arena.
Just by looking at monster.com, it becomes very obvious how important J2EE
has become, and if anyone is planning to make Java their bread and
Given that J2EE is not used in my current job, what is the best way to learn
it on my own and in my free time?
I looked at the websites of community colleges and universities around my
area, and I found that they only offer beginner and intermediate Java
classes, with no emphasis on J2EE.
What do you guys think is a good way to achieve this goal? How do
programmers usually make the transition from Java programmers to J2EE?
I have already experimented with Tomcat and some basic jsp stuff, but i am
sure J2EE is much more than that.
Any idea is greatly appreciated, and if you have a success story, please
share it here!
Cheers
hilz
- 13
- JMS: the confusion BEFORE writing my first Application.I read in the sun jms doc that jms is the java interface to
Middleware, like MQ series.
Does this mean I actually need MQ series? ITs to expensive. Im
already in the programming world, so this is not a school project. My
boss came to me and told me that he would like to connect to a remote
MQ series machine. With it.
Now I have taken the channel and decided to write something at my desk
with out connecting to the remote mq. I mean, even if i didnt have to
do this project, i would still like to learn it.
I really thought that j2ee already had a queing facility built in so I
didnt need to buy mq series.
If i do need a middle where queue piece, then are there any free ones.
I thought i could go into the j2ee command line tool and just set up
the queues the way they have it in the example
Can you straighten out my confusion?
jodasi
- 14
- convert xnl node to xml data typeHi all,
I am new to java programming. In my application I wanted to convert xml
node to an xml data type. The reason behind doing this is: I wanted to
write this xml node (in to a column of xml data type) with in to a
sequel server 2005 database. I am using JDBC driver (version 4) to
connect to the database. My stored procedure from the database side
accepts only xml data type and not xml Node type. So I wanted to
convert this xml Node to XML data type.
Can any help me with any input.
Thanks
Nathan.
- 15
- Starting using Inversion of ControlHi
I have an existing (Java desktop) application, which I'm looking at
converting to use Inversion of Control principles. I'm just starting
to look at the Java containers - HiveMind, Pico, Spring etc.
I'm not sure about how components/services/objects always have to be
instantiated, rather than retrieved from an existing object.
In my application, I have a IHandler interface, a single instance of
which is used by a number of objects.
Currently, the instance is supplied by an Engine class, which has an
inner class implementing IHandler, and a getHandler() method which
returns an instance of the inner class.
I'm wondering how, when using Inversion of Control, I can supply this
instance of IHandler to the objects which require it.
Most of the containers seem to require that the instance is *created*.
However, in this case, the instance should be *returned* from an
existing object (which will also have been created by the container).
What's the best way to deal with this situation?
I could, for example, make the IHandler inner class to be a public
class, so it can be instantiated directly. But I'm not convinced that
exposing the class in this way is the ideal way to do this.
Thanks for your help,
Calum
|
|
|