| JDialog (or any window) sizing |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- list jar contentsI am trying to list the contents of a jar file.
I should be able to run
jar -t -f myjar.jar
but when I run this the command does not return and does not display
any thing.
I have to ctrl-c to terminate the app.
I can get the contents if I use the command line version of winzip.
I have tried
jar -t myjar.jar
and
jar -t -f myjar.jar
thanks for the help
john
- 3
- FW: FreeBSD Upgrade bountycastle-1.16_1 to version 1.25Hi there,
I've emailed the maintainer about this and haven't received a
response in a weeks time. Could someone have a look at this?
Kind regards,
Manfred N. Riem
email***@***.com
http://www.manorrock.org/
-----Original Message-----
From: Manfred N. Riem [mailto:email***@***.com]
Sent: Friday, December 10, 2004 12:07 AM
To: 'email***@***.com'
Cc: 'email***@***.com'
Subject: [FreeBSD Port] Upgrade bountycastle-1.16_1 to version 1.25
Hi there,
A kind request to upgrade bountycastle-1.16 to version 1.25. If you need any
help in doing so, please let me know!
Kind regards,
Manfred N. Riem
email***@***.com
http://www.manorrock.org/
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 4
- KENT DOLAN == DUSTY HILL!!! (was: Travelling Salesmen, the Gimpand KPDolan)"JTK" <email***@***.com> wrote:
> dragonfly99 wrote:
>> i saw your webpage. i was impressed.
>> http://www.anycities.com/user/xanthian/TravellerArt/TravellerArt.html
>> Can you lay down more specifics about
>> the structure of your Travelling
>> Salesman and/or random walk
>> algorithms? i'd be much obliged.
See http://www.well.com/user/xanthian/java/TravellerDoc.html ;
sadly that links to a jar file containing a version about
1/3rd the size of the one I'm running now, which contains a lot
more featuritus captured as Java, but is nowhere near ready to
publish. If you want a "warts and all" copy of the current work
in progress, I can send one to you by email.
> OH MY GOD, KENT IS ACTUALLY ZZ TOP
> BASSIST DUSTY HILL!!!!!:
Funny you should say that. When I was
courting my current wife, she showed the
secretaries working for her a picture of
me, with an earlier incarnation of the
same beard (this was 1991) , and to a
one they responded: "You're marrying ZZ
Top!?!" I was a lot cuter then.
> http://www.lowpft.com/dustwed2.jpg
> http://www.anycities.com/user/xanthian/KentImages/KentByTreeHeadAndShouldersNoFlash.jpg
Posting unworkable URLs doesn't much
help. In anycities rabid insistance
that you get a chance to read one of
their misleading and deceptive "improve
your website" ads, before seeing
anything useful, they disable direct
access to anything that isn't an HTML
file they can corrupt.
To see the above picture thus takes
two steps:
Click here:
http://www.anycities.com/user/xanthian/KentImages/KentImages.html
Then choose the top link "this" to see
the above picture. If you look at some
of the others, you'll notice I've added
a bit of fur.
> TELL ME WITH A STRAIGHT FACE YOU CAN
> TELL THE DIFFERENCE!!!!!!!!
How to tell it's Dusty and not Kent the
man from xanth:
1) Dusty still has a lot of orange color
in the sides of his beard; mine is snow
white except for a score of black hairs
in my moustache.
2) No time in my entire life have I had
a babe like that on my arm, counting two
wives and a daughter all in wedding gowns.
> HE'S BAD, HE'S NATIONWIDE!!!!!!!!!!!!!!!!!!!!!
Worldwide actually, but hardly
admirable.
xanthian, the homelier twin.
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
- 4
- Java Application Programmer for Oracle/Win Envir
Title: Java Application Programmer for Oracle/Win Envir.
Skills: Java Coder/Application Programmer (Web-Based Apps), SQL,
Oracle 8i or 9i, STRUTS
Trinity Consultancy Services is seeking applications from qualified
and experienced software engineers with above skills for various
requirements with their Clients.
Job description:
Java Coder/Application Programmer
We are seeking a Java developer to code applications and code Java
Classes from scratch to help in the development of an nth-tier web
application using Java language and associated technologies, in an
Oracle 8i/9i and Windows environment.
Duties and Responsibilities:
* This position requires a strong Java Application coder (3 years).
Ability to code applications from scratch by writing basic Java code
plus the ability to compile Java Applications using Java Servlets,
Applets, JSP's and JavaBeans. Must be able to create JavaBeans from
scratch. Should be able to track down particular Java code lines,
Scripts, JSPs, Beans, Servlets or Applets.
Required Experience:
* At least 3 years hands-on paid software development experience in
design and coding of Web applications.
* At least 3 years in Java and Object-Oriented software development.
* Experienced in Windows Dev.
* Experienced in large-scale, enterprise systems implementation with
through understanding of system development methodology.
* Must have STRUTS experience.
Required Skills:
* Strong computer programming skills in Java coding of Java Classes
and OO Design.
* Strong programming skills in programming with SQL and Oracle 8i/9i
Database.
* Strong programming skills in J2EE technologies, such as JSP, Java
Servlet, Javabean, EJB, JNDI, MVC, and JDBC API.
* Must have STRUTS experience.
* Good working skills in using Http, SSL, JDBC, RMI, XML, JMS.
* Good working skills in using Windows OS (XP, NT, 2000).
* Good interpersonal and communications skills.
Education:
Bachelor degree, CS or equivalent required.
Trinity Consultancy Services is a leading source of Information
Technology, Engineering and Management Experts that corporations of
all sizes turn to, from Global 2000 corporations to mid-sized and
small organizations nationwide. With the commitment to excellence, is
subtly managed to find, recruit, screen, submit and effectively
organize a technical workforce anywhere in the United States for
various Technical needs of corporation irrespective of its size.
Trinity Consultancy Services is one of its unique kind of the leading
information technology consulting services, and business process
outsourcing organizations committed for excellence.
Trinity provides business consulting, systems integration, application
development, staffing services and managed services to Global 2000
Corporations, medium-sized businesses, and government organizations
throughout the United States.
Trinity can mobilize the right resources, skills and technologies to
enable our clients to reach their dreams by enhanced performance. With
deep industry and business process expertise and broad global
resources, Trinity Consultancy Services is committed for excellence.
Please contact our Human Resource Manager Ms. Ann and send your
detailed Resume with your work authorization status, current salary
and expectations.
Mention the position you are applying in the subject line.
Email: email***@***.com
www.trinityconsultancy.com
- 7
- color palletI'm coding up a routine to dispaly a stacked bar graph using
Graphics2D. Each bar is made by a bunch of rectangles representing
each contributor. The color of each contributor should be different.
I need a way to assign these colors. The number of contributors can
change at runtime. Sequential colors should be well differentiated.
Does anyone have any suggestions for accomplishing this? I'd rather
not make the user specify colors at runtime.
Thanks,
Rob
- 10
- JSP vs XSLT?Which is better JSP or XSLT? I prefer JSP for two reasons performance
and less complicated to learn.
JSPs are compiled one time, then cached, unless the code changes. This
not the case with XSLT, as I understand it.
XSLT is very complicated to learn, in my opinion.
See this article by IBM on JSP vs XSLT:
http://www-106.ibm.com/developerworks/websphere/techjournal/0405_brown/0405_brown.html#sec9
- 13
- CFP Reminder: World Congress on Engineering and Computer Science (WCECS 2007)Call for Papers Reminder: World Congress on Engineering and Computer
Science (WCECS 2007)
From: International Association of Engineers (IAENG)
World Congress on Engineering and Computer Science 2007
San Francisco, USA, 24-26 October, 2007
http://www.iaeng.org/WCECS2007
The WCECS 2007 is organized by the International Association of
Engineers (IAENG), a non-profit international association for the
engineers and the computer scientists. The conference has the focus on
the frontier topics in the theoretical and applied engineering and
computer science subjects. Our last IAENG conference has attracted
more than one thousand participants from over 30 countries, and our
IAENG conference committees have been formed with over two hundred
committee members who are mainly research center heads, faculty deans,
department heads, professors, and research scientists from over 20
countries.
WCECS Congress Co-chairs
Prof. Craig Douglas (WCECS Keynote Speaker & Co-chair)
Professor of Computer Science & Professor of Mechanical Engineering,
University of Kentucky
Senior Research Scientist (corresponding to nonteaching full
professor)
Computer Science Department, Yale University, USA
Prof. Warren S. Grundfest, Fellow, AIMBE, SPIE (WCECS co-chair)
Co-Chair, Biomedical Engineering IDP
Professor of Electrical Engineering and Professor of Surgery
The Henry Samueli School of Engineering & Applied Science
University of California, Los Angeles, USA
Former Chair, SPIE Health Care Engineering & Technology Policy
Former Vice Chair, Health Care Engineering Policy Committee, IEEE
Prof. Lee Schruben, Ph.D. Yale (WCECS & ICMSC co-chair)
Professor and Former Department Chairman
Department of Industrial Engineering and Operations Research
University of California, Berkeley, USA
Prof. Jon Burgstone (ICIMT honorary co-chair)
Faculty Chair
Center for Entrepreneurship & Technology
College of Engineering
University of California, Berkeley, USA
Board Member of the Rock Center for Entrepreneurship at Harvard
Business School, Harvard University
Prof. Su-Shing Chen, Fellow, SPIE (ICCB honorary co-chair)
Emeritus Professor, Department of Computer Information Science &
Engineering, University of Florida, USA;
Principal Investigator of Systems Biology Laboratory,
CAS-MPG Partner Institute for Computational Biology (PICB);
Shanghai Institutes for Biological Sciences; Chinese Academy of
Sciences
Prof. Benjamin Friedlander, FIEEE (ICCST honorary co-chair)
Professor of Electrical Engineering
Department of Electrical Engineering, Jack Baskin School of
Engineering,
University of California, Santa Cruz, USA
The IEEE Third Millennium Medal (2000)
Former Vice Chairman of the Bay Area Chapter of the Acoustics, Speech
and Signal Processing Society
Former Associate Editor of the IEEE Transaction on Automatic Control
Prof. Burghard B. Rieger (ICMLDA honorary co-chair)
Professor of Computational Linguistics
Former Dean (1999-2001) of Faculty of Languages and Literature
Former Head of Department of Linguistic Computing, University of
Trier, Germany
President (1989-93) of the German Society for Linguistic Computing
(GLDV)
Vice-President (1990-94) of the International Society for Terminoly
and Knowledge Engineering (GTW)
Prof. Lei Xu (ICSCA honorary co-chair)
IEEE Fellow and IAPR Fellow,
Member of European Academy of Sciences,
Chair Professor, Department of Computer Science and Engineering,
The Chinese University of Hong Kong, Hong Kong
The conference proceedings will be published by IAENG (ISBN:
978-988-98671-6-4) in hardcopy. The full-text congress proceeding will
be indexed in major database indexes so that it can be assessed
easily. The accepted papers will also be considered for publication in
the special issues of the journal Engineering Letters and other IAENG
journals. Revised and expanded version of the selected papers may also
be included as book chapters in the standalone edited books under the
framework of cooperation between IAENG and Springer. Dr. Mark de
Jongh, Senior Publishing Editor, Springer SBM NL, will also give a
presentation about book publishing with Springer. Dr. Mark de Jongh
will also be available during the conference period to talk to
potential authors whom may have a new book idea/proposal.
The WCECS 2007 is composed of the following 15 conferences (all will
be held at the same location and date):
ICCB'07
International Conference on Computational Biology 2007
ICCE'07
International Conference on Chemical Engineering 2007
ICCS'07
International Conference on Circuits and Systems 2007
ICCSA'07
International Conference on Computer Science and Applications 2007
ICCST'07
International Conference on Communications Systems and Technologies
2007
ICEEA'07
International Conference on Electrical Engineering and Applications
2007
ICEIT'07
International Conference on Education and Information Technology 2007
ICIAR'07
International Conference on Intelligent Automation and Robotics 2007
ICIMT'07
International Conference on Internet and Multimedia Technologies 2007
ICMHA'07
International Conference in Modeling Health Advances 2007
ICMLDA'07
International Conference on Machine Learning and Data Analysis 2007
ICMSC'07
International Conference on Modeling, Simulation and Control 2007
ICSCA'07
International Conference on Soft Computing and Applications 2007
ICSEEM'07
International Conference on Systems Engineering and Engineering
Management 2007
ICSPIE'07
International Conference on Signal Processing and Imaging Engineering
2007
=========
Submission:
WCECS 2007 is now accepting manuscript submissions. Prospective
authors are invited to submit their draft paper in full paper (any
appropriate style) to WCECS{at}iaeng.org by 6 July, 2007. The
submitted file can be in MS Word format, PS format, or PDF formats.
The first page of the draft paper should include:
(1) Title of the paper;
(2) Name, affiliation and e-mail address for each author;
(3) A maximum of 5 keywords of the paper.
Also, the name of the conference that the paper is being submitted to
should be stated in the email.
=============
Important Dates:
Draft Paper Submission Deadline: 6 July, 2007
Camera-Ready Papers Due & Registration Deadline: 30 July, 2007
WCECS 2007: 24-26 October, 2007
It is our target that the reviewing process and the result
notification for each submitted manuscript can be completed within one
month from its submission. The reviewing process is to ensure the
quality of the accepted papers in the WCE congress. The conferences
have enjoyed high reputation among many research colleagues ( for
example, see the http://cs.conference-ranking.net/ or http://www.conference-ranking.com/
or http://www.conference-ranking.org/cs.html ).
More details about the WCECS 2007 can be found at:
http://www.iaeng.org/WCECS2007/index.html
http://www.iaeng.com/WCECS2007/index.html
http://www.iaeng.net/WCECS2007/index.html
More details about the International Association of Engineers, and the
IAENG International Journal of Computer Science, and the IAENG
International Journal of Applied Mathematics can be found at:
http://www.iaeng.org/about_IAENG.html
http://www.iaeng.org/IJCS/index.html
http://www.iaeng.org/IJAM/index.html
The official journal web site of Engineering Letters at:
http://www.engineeringletters.com
Other Engineering Letters web sites at:
http://www.engineeringletters.com
http://www.engineeringletters.net
http://www.engineeringletters.org
http://www.engineeringletter.com
http://www.engineerletters.com
http://www.engineerletter.com
********
It will be highly appreciated if you can circulate these calls for
papers to your colleagues.
- 13
- Sending XML as a String through a web service (Tomcat/AXIS)?Hi, I have a web service written with Tomcat/AXIS. One of my
methods receives a String. Is it possible to send a String of
XML through this method? Will the XML tags confuse the
underlying web service system? Or will the XML be "escaped"
(with the <, > characters rewritten somehow)?
Thanks.
- 13
- Runtime.exec and socketsI submitted this as a bug, but no response. Can anyone help?
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
Runtime.exec() to start a new java program. The new java program
should create a socket connection to another program.
The socket will connect if created and used from the static main
method. It will also work if placed in a static method called from
main. It will not work if I create an object and have the object
execute the same code (which is what I need); it fails both times if
the method is static or not static.
If I run the java program from the command line and not by using
Runtime.exec, it works beautifully.
If while it is blocking I kill the first vm, then the second vm
continues.
ACTUAL -
Blocking
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class ProgA {
public static void main(String[] args) throws Exception {
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("java ProgB");
p.waitFor();
System.out.println("Process Returned");
}
}
///////////////////////////////////////////////////////////////////////
import java.net.*;
import java.io.*;
public class ProgB {
public void service() throws Exception {
//If I move this body of code to main or another static method,
//the program works.
Socket s = new Socket("127.0.0.1", 5000); //Blocking
OutputStream o = s.getOutputStream();
o.write("test data".getBytes() );
s.close();
}
public static void main(String[] args) throws Exception {
ProgB b = new ProgB();
b.service();
}
}
---------- END SOURCE ----------
- 13
- How to get connection to remote hostHi all,
I am beginner in httpunit i am trying to get resonse from a remote
host, but i am not able to get it
the error is
connnection Exception: connection refused; connect
how can i resolve it
thanks and regards,
Arun
- 15
- Interrupt on Java thread..I have two threads, one reading from stdin and writing to a socket
(requestThread),
one reading from a socket and writing to stdout (responseThread).
When the response thread gets a msg from server that an error occurs, it
closes the socket and calls interrupt() for it's thread group before
exiting.
But requestThread never seems to get the interrupt.
It is blocked(?) on a readLine() from the BufferedReader omn stdin.
What am I doing wrong?
- 16
- i18n in Swing, trouble.Hi,
I am building my first Gui with Swing, and in the same time I need to
use the i18n to make it work in Japanese and English.
I use Eclipse and its great Visual Editor to save time, all my files are
utf8 encoded. And, I am under WinXp...
My trouble is the following :
-> If I make a jMenu with some japanese hardcoded text, it appears fine
in my application.
-> If I use a ResourceBundle to get the text, I have garbage. I use the
following line: myMenu.setText(myBundleResource.getString("myTest"));
The .properties files for the japanese is also in Utf8
Do you have any idea why the text in the .properties file is not passed
correctly ? Any help would be really appreciated.
Best Regards,
Schlum
- 16
- build failure on yesterday's -currentHi,
Following the threading, gcc, and symbol changes, I removed /usr/local
and /usr/X11R6 and am building everything from scratch.
jdk15 failed with:
bad class file: /usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/java/nio/channels/AsynchronousCloseException.java
file does not contain class java.nio.channels.AsynchronousCloseException
Please remove or make sure it appears in the correct subdirectory of the classpath.
throws AsynchronousCloseException
^
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
gmake[7]: *** [.compile.classlist] Error 1
gmake[7]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make/sun/javac/recompile/library'
gmake[6]: *** [optimized] Error 2
gmake[6]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make/sun/javac/recompile/library'
gmake[5]: *** [all] Error 1
gmake[5]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make/sun/javac/recompile'
gmake[4]: *** [all] Error 1
gmake[4]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make/sun/javac'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make/java/javac'
gmake[2]: *** [all] Error 1
gmake[2]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make/java'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/usr/ports/java/jdk15/work/j2se/make'
gmake: *** [j2se-build] Error 2
*** Error code 2
Stop in /usr/ports/java/jdk15.
*** Error code 1
Stop in /usr/ports/java/jdk15.
stretchlimo/usr/ports/java/jdk15;
This might be known already, but I didn't see a posting on this yet.
If you already know, I'm patient and will wait for a fix.
Thanks,
==ml
--
Michael W. Lucas email***@***.com, email***@***.com
http://www.BlackHelicopters.org/~mwlucas/
Coming Soon: "Absolute FreeBSD" -- http://www.AbsoluteFreeBSD.com
On 5/4/2007, the TSA kept 3 pairs of my soiled undies "for security reasons."
- 16
- Logging APIHello,
I have been using the logging API to log HTTP requests. I have an
object, which resembles a HTTP request and has methods to extract the
typical fields of a HTTP request.
Now, I have noticed that you can only pass log messages as a String and
not as an object. Also I saw that Formatters format "around" this
String. I think that is quite a limitation for my purpose.
What's if I have different Log Formats, which I would like to apply.
For example, there are different levels of verbosity. The apache log
format "combined" sends more output then "common". Maybe I also want to
define my own custom ones.
Then I would like to have a Formatter for each output Format. Do do
that, however, Formatters would have to be able to work on those HTTP
objects, which contain the fields.
That does not seem to be possible under the current logging API or am I
missing someting here? I really don't understand, why the message is
not being stored as an Object but a String - that only limits the use
of the Formatter.
Can somebody elaborate on this. Maybe it should be brought up with Sun?
- 16
|
| Author |
Message |
Bill Michaelson

|
Posted: 2005-12-22 4:20:00 |
Top |
java-programmer, JDialog (or any window) sizing
I would like my JDialog to pop up with a size that is just adequate to
contain what is within, which includes various components and layouts in
the hierarchy. I'm hoping someone can tell me in a nutshell what
sequence of operations to perform.
|
| |
|
| |
 |
Vova Reznik

|
Posted: 2005-12-22 4:23:00 |
Top |
java-programmer >> JDialog (or any window) sizing
Bill Michaelson wrote:
> I would like my JDialog to pop up with a size that is just adequate to
> contain what is within, which includes various components and layouts in
> the hierarchy. I'm hoping someone can tell me in a nutshell what
> sequence of operations to perform.
>
java.awt.Window::pack()
and Window subs
|
| |
|
| |
 |
Bill Michaelson

|
Posted: 2005-12-22 4:40:00 |
Top |
java-programmer >> JDialog (or any window) sizing
Thank you so much for the instant response. It works fine for two of
three cases. The third case still leaves me with a question. The
containment hierarchy in question has a JTable in a JScrollPane. I'd
like to set that portion of the composition to a particular size and
allow the containing JDialog and other elements to be sized around it
automatically. If I simply call pack(), the JTable area is much too large.
Your recommendation, please?
Vova Reznik wrote:
> Bill Michaelson wrote:
>
>> I would like my JDialog to pop up with a size that is just adequate to
>> contain what is within, which includes various components and layouts
>> in the hierarchy. I'm hoping someone can tell me in a nutshell what
>> sequence of operations to perform.
>>
>
> java.awt.Window::pack()
> and Window subs
|
| |
|
| |
 |
Vova Reznik

|
Posted: 2005-12-22 4:48:00 |
Top |
java-programmer >> JDialog (or any window) sizing
Preferred size of JScrollPane with JTable inside is:
Component c = new JScrollPane(new JTable());
System.out.println(c.getClass().getName()+ ": " +c.getPreferredSize());
javax.swing.JScrollPane: java.awt.Dimension[width=453,height=403]
You may change JScrollPane preferred size before calling pack()
Bill Michaelson wrote:
> Thank you so much for the instant response. It works fine for two of
> three cases. The third case still leaves me with a question. The
> containment hierarchy in question has a JTable in a JScrollPane. I'd
> like to set that portion of the composition to a particular size and
> allow the containing JDialog and other elements to be sized around it
> automatically. If I simply call pack(), the JTable area is much too large.
>
> Your recommendation, please?
>
> Vova Reznik wrote:
>
>> Bill Michaelson wrote:
>>
>>> I would like my JDialog to pop up with a size that is just adequate
>>> to contain what is within, which includes various components and
>>> layouts in the hierarchy. I'm hoping someone can tell me in a
>>> nutshell what sequence of operations to perform.
>>>
>>
>> java.awt.Window::pack()
>> and Window subs
>
>
|
| |
|
| |
 |
Bill Michaelson

|
Posted: 2005-12-22 6:48:00 |
Top |
java-programmer >> JDialog (or any window) sizing
Much to my embarrassment, I tried setPreferredSize(int,int) on the
JScrollPane and assumed that the method did not exist for the class when
the compile failed. I didn't think of using a Dimension object until I
read your post. I have it working reasonably well now.
Thanks again for helping. I know this is basic stuff, but it gets
pretty frustrating sometimes.
Vova Reznik wrote:
> Preferred size of JScrollPane with JTable inside is:
>
> Component c = new JScrollPane(new JTable());
> System.out.println(c.getClass().getName()+ ": " +c.getPreferredSize());
> javax.swing.JScrollPane: java.awt.Dimension[width=453,height=403]
>
> You may change JScrollPane preferred size before calling pack()
>
>
> Bill Michaelson wrote:
>
>> Thank you so much for the instant response. It works fine for two of
>> three cases. The third case still leaves me with a question. The
>> containment hierarchy in question has a JTable in a JScrollPane. I'd
>> like to set that portion of the composition to a particular size and
>> allow the containing JDialog and other elements to be sized around it
>> automatically. If I simply call pack(), the JTable area is much too
>> large.
>>
>> Your recommendation, please?
>>
>> Vova Reznik wrote:
>>
>>> Bill Michaelson wrote:
>>>
>>>> I would like my JDialog to pop up with a size that is just adequate
>>>> to contain what is within, which includes various components and
>>>> layouts in the hierarchy. I'm hoping someone can tell me in a
>>>> nutshell what sequence of operations to perform.
>>>>
>>>
>>> java.awt.Window::pack()
>>> and Window subs
>>
>>
>>
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-12-22 9:39:00 |
Top |
java-programmer >> JDialog (or any window) sizing
Bill Michaelson wrote:
> Much to my embarrassment, I tried setPreferredSize(int,int) on the
> JScrollPane and assumed that the method did not exist for the class when
> the compile failed.
The JavaDocs (or an automplete IDE) are much handy here..
<http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JScrollPane.html>
Do a search on 'setpref', and click the link.
'Voila' - setPreferredSize inherets from JComponent and
accepts a Dimension.
--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-12-22 16:43:00 |
Top |
java-programmer >> JDialog (or any window) sizing
On Wed, 21 Dec 2005 17:48:22 -0500, Bill Michaelson <email***@***.com>
wrote, quoted or indirectly quoted someone who said :
>Much to my embarrassment, I tried setPreferredSize(int,int) on the
>JScrollPane and assumed that the method did not exist for the class when
>the compile failed.
setPreferredSize came in with JDK 1.5. Prior to that you must
override getPreferredSize (and brothers).
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Bill Michaelson

|
Posted: 2005-12-23 22:47:00 |
Top |
java-programmer >> JDialog (or any window) sizing
Roedy Green wrote:
> On Wed, 21 Dec 2005 17:48:22 -0500, Bill Michaelson <email***@***.com>
> wrote, quoted or indirectly quoted someone who said :
>
>
>>Much to my embarrassment, I tried setPreferredSize(int,int) on the
>>JScrollPane and assumed that the method did not exist for the class when
>>the compile failed.
>
> setPreferredSize came in with JDK 1.5. Prior to that you must
> override getPreferredSize (and brothers).
I haven't been thinking in those terms, but I'm catching on as I scrape
the rust off my Java lobe. Thanks for the clue...
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- What happensHi,
Am a newbie to CORBA. What happens when a CORBA object is destroyed? I
heard that its ORB reference becomes invalid? If this' true, what
exactly is meant by 'invalid'? What if I try to refer the object after
it is destroyed? And also how do I come to know if the object is
destroyed?
Thanks.
- 2
- class data sharing subjective test resultsHi all,
I made some tests with the new "Class Data Sharing" function
provided by the JVM (since version 1.5.0 / 5.0) and decided
to share my class data sharing discoveries with the group
(this topic is not often discussed here).
The tests were made on an Un*x system (Linux Fedora Core 3).
First of all, the performance gain is very real, especially
when launching lots of small apps.
Basically, it comes down to using the parameter/value
"-Xshare:off", "-Xshare:on" or "-Xshare:auto" (which is
the default) when calling the JVM.
The command line: "java -Xshare:dump" can be used to
force the creation of the memory-mapped archive file
(the shared classes). (btw this step is apparently
necessary on some Un*x systems!?. My system would
/not/ default to using the sharing, I had to
-Xshare:dump once and then add -Xshare:on to force my
application sharing the classes.)
I had some "text file utilities" I wrote in Java which I'm
used to call from the command line (or from shell scripts).
This is clearly one area where the JVM's startup time
is a problem. I noticed gain of about 30% in this case
(using a non-scientific approach repeated many case, with
and without CDS).
If the JVM is installed in userland, each user will have his
own "cached" file (classes.jsa, about 11 Mb on my machine).
If only one JVM is installed for all the users, all the
users will share the same classes.jsa file (JSA for "Java
Shared Archive").
It may be possible to force different identical JVM
installed in different userland to use the same classes.jsa
but I didn't try to do this (simply copying the classes.jsa
file from one user on top of the classes.jsa file of another
user doesn't work, although the files have the same
length [but different checksums]).
I was pleasingly surprised by those first results and I
decided to force all my apps to use the JVM 1.5.0 and its
class data sharing feature, including IntelliJ IDEA (which
comes with its own JRE and refuse to run with an 1.5 JRE
without some hacking).
After days of "switching" to an 1.5 JVM and forcing all my
apps to use class data sharing, I can tell that overall
everything "Java related" is a little bit more responsive.
It is particularly noticeable when calling Java utilities
from the command line (which is no surprise) but also when
running unit tests (I tend to launch my test(s) quite often).
The memory footprint is also reduced compared to 1.4.2
(when running several apps).
I'm curious about your results too :)
See you all very soon (and "hi" to the c.l.j.p. regular
I met on freenode's #java saturday ;),
Jean
P.S : If I understood correctly, Apple made their
own class data sharing "hack" for Java (way before 1.5)
and Sun basically copied their "idea". Whatever... This
means that developers using MacOS X benefits automagically
from "class sharing" since quite some time and have
nothing particular to do in order to use it.
- 3
- Problem with update Manager in eclipseHi
I have been trying to access the eclipse update site.
Unfortunately when I go on the newly created eclipse item
in the feature updates pane things seem to stop. A
message
Connecting... Connecting to
"http://update.eclipse.org/updates"
appears but nothing happens and the screen kind of hangs
until i press the red button (cancel current operation
option). I work from behind a proxy. I did the
appropriate settings in the preferences (entering the proxy name and
port). I expect to be asked for my username and password and
subsequently
be shown the builds. But nothing seems to be
happening.
But if I go to the eclipse item, right click and in
the properties select "website" instead of the "update
site" everything seems to work fine....as in i access the site
(updates still missing)
What is the reason of this behavior could i be doing
something wrong? I am new to eclipse....could anybody please help.
regards
- 4
- how to map from display metrics to physical metrics...Suppose I have a screen which is 1024x768, how can I map this rectangle in
pixels into physical world dimensions in meters or in inches? Actually I
want to know the physical size of the viewable area of the monitor...
Please help me...
- 5
- RPN CalculatorI've searched the web for a couple of hours for a calculator with this
requirements
It has to
0) be free to download and use
1) be able of RPN
2) be able to run in a standalone window (i.e. not in a web browser)
3) be written in java
4) preferably be open source
Someone who can give me a hint???
- 6
- Array reference in for loopI have a validate method in a bean class that works and now I want to
condense it into a for loop.
Here is what I have:
//firstname and lastname are declared earlier
public boolean validate()
{
boolean allOk=true;
if (firstName.equals("")) {
errors.put("firstName","Please enter your first name");
allOk=false;
}
if (lastName.equals("")) {
errors.put("lastName","Please enter your last name");
allOk=false;
}
return allOk;
}
My attempt doesnt work because I cant seem to figure out how to put
the array reference in the key part of the errors.put method:
public boolean validate()
{
boolean allOk=true;
String [] myarray = {firstname, lastname}
for(int i=0;i < myarray.length;i++)
{
if (myarray[i].equals("")) {
errors.put(myarray[i],"Please enter your " + myarray[i]);
allOk=false;
}
}
return allOk;
}
The results dont validate any of my data so I assume I have something
wrong with my array. Please advise.
- 7
- aliasHi,
I may be jumping guns here. I mean I'm totally new to java and yet, I
feel the need to do something like this for typing much less,
o = System.out.println; // problem, what data type for var of o here?
undefined.
or
alias o = System.out.println; // alias is supposed to be a special
command or the sort?
then, I do something like this
for (int i=0; i < 5; i++) {
switch(i)
case 0:
case 2:
case 4:
o(i + " is an even number"); // instead of System.out.println(i +
" is an even number");
break;
case 1:
case 3:
case 5:
o(i + " is an odd number"); // instead of System.out.println(i + "
is an odd number");
break;
default:
o(i + " is neither an odd nor even number");
// instead of System.out.println(i + " is neither an odd nor even
number");
}
Doable? How? TIA.
- 8
- Induction question, help needed.Help needed on this question. Any help is appreciated. Thanks in
advance.
Given a binary string (i.e. a finite sequence of 0's and 1's) we
choose any two digit substring 01 and replace it by a string of the
form 100...0 using an arbitrary (but finite) number of zeros. Prove
by induction that this transformation can not be performed infinitely
many times, i.e. this sequence of transformations must terminate for
any input string.
- 9
- "this" statement?The "this" statement that is used in the method "exitRoom" and "explore" is
that synonymous with an "Explorer" object?
public class Explorer implements PlayerBehavior {
private String my_name;
private String my_secret_word;
private RoomBehavior where_I_am_now;
public Explorer(String name, String word){
my_name = name;
my_secret_word = word;
where_I_am_now = null;
}
public String speak(){
return my_secret_word; }
public void exitRoom(){
if ( where_I_am_now != null )
{ where_I_am_now.exit(this);
where_I_am_now = null;
}
}
public boolean explore(RoomBehavior r){
if ( where_I_am_now != null )
{ exitRoom(); }
boolean went_inside = r.enter(this);
if ( went_inside )
{ where_I_am_now = r; }
return went_inside;
}
public RoomBehavior locationOf(){
return where_I_am_now; }
}
- 10
- Open Source Document Management in JavaHas anybody tried "Corendal DocSide" from http://www.corendal.com ? It
looks like a pretty clean electronic document management application.
Any experience with this tool ? (demo at
http://www.corendal.com/java-corendal/docside/home/)
- 11
- Is there a startup banner class?Hello,
I have an application to which I would like to add a startup banner.
Much like other applications that display this banner while performing
a somewhat lenghty (by computing standards) process in the background,
I have the same need.
Is there a class that supplies the panel (banner) and methods to
determine when the background process has completed?
Thanks in advance,
Todd
- 12
- CloneableWould have been possible to some how redefine Cloneable so that clone
did not return an object but rather at object of the type implementing
clone?
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm
Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
- 13
- Bug or featureHi, can someone explain the behaviour of that snip
public class Test
{
public static void main(String[] args)
{
try
{
Class c = Class.forName("BUG");
}
catch (ClassNotFoundException e)
{
}
System.out.println("Everything works?");
try
{
Class c = Class.forName("NotbUg");
}
catch (ClassNotFoundException e)
{
}
System.out.println("Still works?");
try
{
Class c = Class.forName("bUg");
}
catch (ClassNotFoundException e)
{
}
System.out.println("Everything works!!");
}
}
class BUG
{
}
In not works on JDK 1.4.2 but JDK 1.1.4. Bug or feature that question is.
Thanks in advance.
Serge
- 14
- 15
- Hashtable qWhen traversing an Enumeration of Hashtable keys, I know that modifying the
HT can cause problems. But is doing lookups okay? E.g., in the following
code:
<assume ht is a reference to a Hashtable object>
Enumeration e = ht.keys();
Object o;
while(e.hasmore()) {
o = e.next();
System.out.println(o + ": " + ht.get(o));
}
Is this guaranteed to print out all of the key-value pairs?
|
|
|