| JTable assigning default column widths problem |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- 3
- Plotting 2D grpah in JavaI was wondering if there is some package available that can plot 2D graphs
in Java? I have developed a piece of software whcih simulates behaviours of
models and at the moment I save the data to file and use Excel to view it.
I was hoping to interface something directly with my Java program to view
the results. Is there anything out there?
Thanks,
Allan
- 3
- dragging graphics in a JTableI am interested in creating a graphics object (for example, a big dot)
creating it such that it can be moved within a cell and then moved
across cells. I had something working outside of a JTable (using
Point2D) and overiding paintComponent such that the drawing routine
looks like:
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
g2d.setComposite(makeComposite(.5f));
}
I have two questions at this point. First, is it feasible? and Second,
if feasible, how would one generally go about it (custom editor, firing
events when it the object gets near a cell border, etc.?)?
hanks - Lou
- 3
- data synchronisation - java server side or www server side?I develop the application, which consists of the following:
- java server module (database connection, query execution, data update)
- www server module (www clients handling, data exchange with java server)
- many www clients (changing data, and need to have all data updated, so
synchronisation is required)
The question is:
To decrease the need of working with database and network load, where should
I keep
synchronised data taken out of database? At the java server side or at the
www server side?
- 9
- Binary to Hexadecimal ConversionHello! I made this program of converting binary to hexadecimal, there
are few errors which are new to me. Please check it out. Thanks!
<code>
import java.lang.*;
import java.io.*;
class BinaryDecoder{
public static void main(String args[]) throws IOException{
InputStreamReader stdin = new InputStreamReader(System.in);
BufferedReader console = new BufferedReader(stdin);
System.out.print("Enter a number in binary: ");
String input = console.readLine();
int decimal=0;
for(int counter=input.length()-1; counter>=0; counter--){
if(input.charAt(counter)=='1'){
int exp=input.length()-1-counter;
decimal+=Math.pow(2,exp);
}
}
int hexadecimal=0;
int powerOfTen=1;
int number=decimal;
int counter=0;
int[] hex = new int[20];
while(number>0){
int remainder=number%16;
hex[counter] = remainder;
counter++;
number/=16;
}
System.out.print("Hexadecimal: ");
for(int count=hex.length; count>=0; count--){
if(hex[count]==10)
System.out.print("A");
else if(hex[count]==11)
System.out.print("B");
else if(hex[count]==12)
System.out.print("C");
else if(hex[count]==13)
System.out.print("D");
else if(hex[count]==14)
System.out.print("E");
else if(hex[count]==15)
System.out.print("F");
else
System.out.print(hex[count]);
}
}
}
</code>
- 12
- Learning J2ee, got newbie question.Hello. I picked up a Beginner's J2ee book. I'm going through the
examples, but one of the examples I am stuck on. I cannot get past the
error message:
404 - Resource Not found.
I am running Tomcat, I believe 5.5.8. Here's the directory structure
that I have:
webapp/Ch05/
login.html
Login.java
Login.class
Here's the login.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Login</h1>
Please enter your username and password.
<form action="/Ch05/Login" method="POST">
<p><input type="text" name="username" length="40">
<p><input type="password" name="password" length="40">
<p><input type="submit" value="Submit">
</form>
</body>
</html>
My browser complains that Login resource is unavailable. Here's
Login.java, which is compiled and in the same directory.
package web;
import java.servlet.http.*;
import java.io.*;
public class Login extends HttpServlet {
public void doPost( HttpServletRequest request, HttpServletResponse
response)
{
String username = request.getParameter( "username");
try {
response.setContentType( "text/html");
PrintWriter writer = response.getWriter();
writer.println( "<html><body>");
writer,println( "Thank you, " + username +
". You are now logged into the system.");
writer.println( "</body></html>");
writer.close();
} catch( Exception e) {
e.printStackTrace();
}
}
}
Anyways, does anyone know what I'm doing wrong here? (I just typed the
example pretty quickly, so there might be typos, but the above compiles
without complaint.) Thanks.
- 12
- Use that patch which comes from the M$
Microsoft Partner
this is the latest version of security update, the
"November 2003, Cumulative Patch" update which fixes
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three new vulnerabilities.
Install now to help protect your computer
from these vulnerabilities.
This update includes the functionality of all previously released patches.
System requirements: Windows 95/98/Me/2000/NT/XP
This update applies to:
- MS Internet Explorer, version 4.01 and later
- MS Outlook, version 8.00 and later
- MS Outlook Express, version 4.01 and later
Recommendation: Customers should install the patch at the earliest opportunity.
How to install: Run attached file. Choose Yes on displayed dialog box.
How to use: You don't need to do anything after installing this item.
Microsoft Product Support Services and Knowledge Base articles can be found on the Microsoft Technical Support web site.
http://support.microsoft.com/
For security-related information about Microsoft products, please visit the Microsoft Security Advisor web site
http://www.microsoft.com/security/
Thank you for using Microsoft products.
Please do not reply to this message.
It was sent from an unmonitored e-mail address and we are unable to respond to any replies.
----------------------------------------------
The names of the actual companies and products mentioned herein are the trademarks of their respective owners.
Copyright 2003 Microsoft Corporation.
<HTML>
<HEAD>
<style type='text/css'>.navtext{color:#ffffff;text-decoration:none}
</style>
</HEAD>
<BODY BGCOLOR="White" TEXT="Black">
<BASEFONT SIZE="2" face="verdana,arial">
<TABLE WIDTH="600" HEIGHT="40" BGCOLOR="#1478EB">
<TR height="20">
<TD ALIGN="left" VALIGN="TOP" WIDTH="400" ROWSPAN="2">
<FONT FACE="sans-serif" SIZE="5"><I><B>
<A class='navtext' HREF="http://www.microsoft.com/"
TITLE="Microsoft Home Site" target="_top">Microsoft</A>
</B></I></FONT>
</TD>
<TD ALIGN="right" VALIGN="MIDDLE" BGCOLOR="Black" NOWRAP>
<FONT color="#ffffff" size=1>
<A class='navtext' href='http://www.microsoft.com/catalog/' target="_top">All Products</A> |
<A class='navtext' href='http://support.microsoft.com/' target="_top">Support</A> |
<A class='navtext' href='http://search.microsoft.com/' target="_top">Search</A> |
<A class='navtext' href='http://www.microsoft.com/' target=_top>
Microsoft.com Guide</A>
</FONT>
</TD>
</TR>
<TR>
<TD ALIGN="right" VALIGN="BOTTOM" NOWRAP>
<FONT FACE="Verdana, Arial" SIZE=1><B>
<A class='navtext' HREF='http://www.microsoft.com/' TARGET=" top">
Microsoft Home</A> </B>
</FONT>
</TD>
</TR>
</TABLE>
<IMG SRC="cid:ucvsmvj" BORDER="0"><BR><BR>
<TABLE WIDTH="600"><TR><TD><FONT SIZE="2">
Microsoft Partner<BR><BR>
this is the latest version of security update, the
"November 2003, Cumulative Patch" update which fixes
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three new vulnerabilities.
Install now to help protect your computer
from these vulnerabilities.
This update includes the functionality of all previously released patches.
</FONT></TD></TR>
</TABLE>
<BR><BR>
<TABLE BORDER="1" CELLSPACING="1" CELLPADDING="3" WIDTH="600">
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> System requirements</B>
</FONT></TD>
<TD NOWRAP><FONT SIZE="1">Windows 95/98/Me/2000/NT/XP</FONT></TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> This update applies to</B>
</FONT></TD><TD NOWRAP>
<FONT SIZE="1">
MS Internet Explorer, version 4.01 and later<BR>
MS Outlook, version 8.00 and later<BR>
MS Outlook Express, version 4.01 and later
</FONT>
</TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> Recommendation</B></FONT></TD>
<TD NOWRAP><FONT SIZE="1">Customers should install the patch at the earliest opportunity.</FONT></TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> How to install</B></FONT></TD>
<TD NOWRAP><FONT SIZE="1">Run attached file. Choose Yes on displayed dialog box.</FONT></TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> How to use</B></FONT></TD>
<TD NOWRAP><FONT SIZE="1">You don't need to do anything after installing this item.</FONT></TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH="600"><TR><TD><FONT SIZE="2">
Microsoft Product Support Services and Knowledge Base articles
can be found on the <A HREF="http://support.microsoft.com/" TARGET="_top">Microsoft Technical Support</A> web site. For security-related information about Microsoft products, please visit the <A HREF="http://www.microsoft.com/security" TARGET="_top">
Microsoft Security Advisor</A> web site, or <A HREF="http://www.microsoft.com/contactus/contactus.asp" TARGET="_top">Contact Us.</A>
<BR><BR>
Thank you for using Microsoft products.<BR><BR></FONT>
<FONT SIZE="1">Please do not reply to this message. It was sent from an unmonitored e-mail address and we are unable to respond to any replies.<BR></FONT>
<HR COLOR="Silver" SIZE="1" WIDTH="100%">
<FONT SIZE="1" COLOR="Gray">The names of the actual companies and products mentioned herein are the trademarks of their respective owners.</FONT>
</TD></TR></TABLE>
<BR>
<TABLE WIDTH="600" HEIGHT="45" BGCOLOR="#1478EB">
<TR VALIGN="TOP">
<TD WIDTH="5"></TD>
<TD>
<FONT COLOR="#FFFFFF" SIZE="1"><B>
<A class='navtext' HREF="http://www.microsoft.com/contactus/contactus.asp" TARGET="_top">Contact Us</A>
|
<A class='navtext' HREF="http://www.microsoft.com/legal/" TARGET="_top">Legal</A>
|
<A class='navtext' HREF="https://www.truste.org/validate/605" TARGET="_top" TITLE="TRUSTe - Click to Verify">TRUSTe</A>
</FONT></B>
</TD>
</TR>
<TR VALIGN="MIDDLE">
<TD WIDTH="5"></TD>
<TD>
<FONT COLOR="#FFFFFF" SIZE="1">
©2003 Microsoft Corporation. All rights reserved.
<A STYLE="color:#FFFFFF;" HREF="http://www.microsoft.com/info/cpyright.htm" TARGET="_top">Terms of Use</A>
|
<A STYLE="color:#FFFFFF;" HREF="http://www.microsoft.com/info/privacy.htm" TARGET="_top">
Privacy Statement</A> |
<A STYLE="color:#FFFFFF;" HREF="http://www.microsoft.com/enable/" TARGET="_top">Accessibility</A>
</FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
GIF89ah
GIF89a
- 12
- Java Component SchedulingIn my system I have a java component which I want to activate only
within a certain time window.
It is a distributed system consisting of a jobproducer which hands out
tasks to the workers. Each worker runs on a different host. I want a
worker to start up and process jobs only if the time is right.
I am currently thinking along the following lines:
- pass in a time-window argument to the worker program e.g. 1900-0600
(7pm to 6am)
- if the current time is valid, it registers with the job producer and
starts receiving/processing jobs
- if the current time is not valid, it sleeps for a bit and tries
again.
- after completing a job, it checks whether it can take on another job
at the current time. If it can't it sleeps.
I don't really like the idea of the sleeps. I also don't want the
producer to be burdened with the task of activating workers at certain
times. Is there a better way?
Does anyone have any experience of doing something like this? Any help
would be appreciated.
- 12
- MVC Framework for Swing?Hello:
I'm looking for an MVC framework for Swing apps. I'm thinking of
something similar to Struts, but for desktop apps. I keep on writing
controllers for each Swing app I develope, and I can't believe there's not
a framework out there to expedite this.
Has anybody invented this yet?
Thanks
- 12
- How to disable automatic scrolling of JScrollPane / JTextPane (Swing)Hi,
I want to be able to enable / disable the automatic scrolling performed when
adding text to a JTextPane. A JScrollPane has a viewport set to the
textpane. The text is added within a thread invoked using
SwingUtilities.invokeLater(...). Only the automatic scrolling should be
disabled, the user must still be able to scroll using the scrollbars etc.
and be able to enable the automatic scrolling again. (I'm using
jdk1.5.0_03.)
Here is how some parts my code look like:
...
<init>
...
jTextPane = new JTextPane();
JScrollPane jScrollPane = new JScrollPane();
jScrollPane.setViewportView(textPane);
...
<some-method>
...
StyledDocument styledDocument = (StyledDocument)jTextPane.getDocument();
...
<call addText-method>
...
<addText-method>
...
Runnable r = new Runnable() {
public void run() {
try {
styledDocument.insertString(styledDocument.getLength(), text,
style);
} catch (BadLocationException e) {
e.printStackTrace();
}
}
};
SwingUtilities.invokeLater(r);
...
Every time the <addText-method> is called the JScrollPane scrolls to the end
of the document. How can I enable / disable that automatic scrolling and
still use a thread / invokeLater to add the text?
Greetings,
ODB
- 12
- Blog Musing: "contextual usage patterns"An interesting post by Andy Roberts, CTO of Bowstreet.
"One of the things lacking with any OO programming language like Java is the
idea of capturing 'contextual usage patterns'. By this I mean the ability
to capture the essence of how an object is to be used in the context of
various environments. I use the term "contextual usage pattern" to mean the
usage pattern of an object in some context....
More: http://radio.weblogs.com/0131247/
-S
- 14
- 15
- [ANNOUNCE] Caught on Tape: Bi-Directional EDI to XML Mapping![ANNOUNCE]
New Online Video Demonstrations Show How to Simplify Legacy Integration
Bedford, Mass. - September 7, 2005 - Bedford, MA - Stylus Studio
(http://www.stylusstudio.com), the industry-leading provider of XML
development tools for advanced data integration, today announced the
release of a new educational video for the XML community. The new video
demonstrates how to set up bi-directional data mapping using Stylus
Studio adapter URLs to get any legacy data format, for example, EDI,
into XML, then how to propagate changes made to the XML file back to
the original EDI source file. "Bi-directional EDI to XML Mapping Using
Stylus Studio Adapters" is the third installment of the Convert to XML
series which covers various data integration topics involving flat
files or other legacy data formats. The new video is free and can be
viewed at:
http://www.stylusstudio.com/learn_convert_to_xml.html#adapters
Stylus Studio? On Demand and In Demand
Stylus Studio is committed to providing free educational materials in
addition to our innovative and productive XML tools, to give the XML
community to give them the edge they need to be successful in their
everyday work. The combination of the Stylus Studio XML IDE and our
growing library of free XML resources, tutorials, whitepapers, video
demonstrations, and industry interviews can greatly simplify advanced
XML development challenges. The new online video demonstration covers
the following topics:
?How to use Stylus Studio's Adapter URL technologies to convert
EDI to XML and back again.
?Converting an EDI data model to XML Schema with the EDIFACT to
XML Schema wizard.
?Overview of the built-in XML Converters for working with
hundreds of different EDI formats.
?Customizing the way EDI segments are converted to XML in
Stylus Studio.
?Converting the EDI 96A Message Type to an XML document.
?Using the Stylus Studio XSLT Mapper to get the converted XML
into a more formal XML standard.
?Using the EDIFACT to XML Schema wizard to generate an XML
Schema based on the EDI 96A Message Schema.
?Configuring the EDIFACT to XML Schema Wizard.
?Browsing a converted EDIFACT data model in the XML Schema
Editor.
?Validating a converted EDI document against an XML Schema.
?Using Stylus Studio's adapter URL to write back changes made
to the XML into its original EDI format (round-trip conversion).
?Customizing the display options in the XSLT mapper.
About Stylus Studio?
Stylus Studio? a product from DataDirect Technologies, an operating
company of Progress Software Corporation, is the industry's most
innovative XML IDE providing advanced support for XML and its related
technologies: XSL, XSLT, XML Schema, DTD, SOAP, WSDL, SQL/XML, XML
mapping and XQuery. Used by leading software developers world-wide,
Stylus Studio simplifies XML programming and enhances developer
productivity through innovation. For more information, visit:
http://www.stylusstudio.com
Stylus Studio is a trademark of Progress Software Corporation in the
U.S. Any other trademarks or service marks contained herein are the
property of their respective owners.
For More Information:
Jason Mazur
Public Relations Manager, Stylus Studio
Telephone: 781-280-4488
Email: email***@***.com
- 15
- JTable cell selection eventGreetings,
I have an application that uses a JTable. When the user changes the
value in one of the cells and moves to another cell (with either the
mouse or keyboard), I want to do something with the new value of the
changed cell, any idea how I can capture this event?
Thanks in advance,
Don
- 16
|
| Author |
Message |
danb

|
Posted: 2003-8-20 18:19:00 |
Top |
java-programmer, JTable assigning default column widths problem
"Richard Morris" <email***@***.com> wrote in message news:<jgw0b.813144$email***@***.com>...
>
> tblNames.getColumn("Active").setPreferredWidth(40);
> tblNames.getColumn("First Name").setPreferredWidth(150);
> tblNames.getColumn("Last Name").setPreferredWidth(150);
>
try this:
tblNames.getColumnModel().getColumn("Active").setPreferredWidth(40);
or
tblNames.getColumnModel().getColumn(0).setPreferredWidth(40);
-Dan
email***@***.com
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- 2
- Vista/Java security test - applets/jwsBugs reported* against Java under the new Vista/IE
security model affect signed applets, and also
trusted JWS applications.
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6548078>
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6504236>
The basic gist is that Vista imposes a more
restrictive security environment (particularly
to do with file access) than the original
trusted app. would receive.
It had earlier been noted that some JWS/browser
interaction problems can be sorted by 'disconnecting'
the launch from the browser and any security model
it might impose, so that led me to wonder if a new
ability of the JNLP API's BasicService in Java 6 might
help here.
The BasicService.showDocument(URL) method will
normally show the URL in the user's default browser,
but Java 6+ will hand an URL for a JNLP file
directly to javaws.
So I have a test..
Here is an unsigned web start application that
should not be affected by the bug.
<http://www.physci.org/jws/jwsapp.jnlp>
It is intended to display details of launch files,
and also offer to launch them - so it is running as
Java 6+.
Here is a *signed* web start app. that requests
full permissions, if launched from IE, it should
trigger the bug..
<http://www.physci.org/giffer/giffer.jnlp>
However, if my theory is correct (I don't have
access to machines running Vista), the first app.,
the launcher, should be able to launch the second
app., the Gif encoder**, just fine.
** Or it's 'big brother' listed below it..
<http://www.physci.org/giffer/giffer0512.jnlp>
Can anyone with Vista tell me if it works to
get around this bug, by launching trusted JWS
apps. directly from a sandoxed JWS app.?
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200707/1
- 3
- No X11 DISPLAY variable was set, but this program performed an operation which requires it.Hi all,
I am trying to run my program on the server. I connected to the server
through ssh and typed the run command. But I get the following
message. This is the first time that I tried to the program in my
laptop, so I don't know what's going on. Could anyone please let me
know what is going on here and suggest how to solve that problem?? I
am using Fedora Core 4. And the program that I am trying to run is a
java program with RePast simulation package. Thank you.
-----------------------------------------------------
lastrada-bin$ ./guirun.sh
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an
operation which requires it.
at
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:310)
at java.awt.Frame.<init>(Frame.java:419)
at javax.swing.JFrame.<init>(JFrame.java:194)
at uchicago.src.sim.engine.Controller.setModel(Unknown Source)
at uchicago.src.sim.engine.SimInit.load(Unknown Source)
at uchicago.src.sim.engine.SimInit.load(Unknown Source)
at uchicago.src.sim.engine.SimInit.loadModel(Unknown Source)
at RandomMoveInGrid.GUIModel.main(GUIModel.java:179)
- 4
- JNI call ending in EXCEPTION_ACCESS_VIOLATIONGordon,
You are right about the not checking env. However, I continue to get -1
from the JNI_CreateJavaJVM call, that corresonds to JNI_ERR.
Do you have a sample code or project with proper settings for Microsoft
Visual C++
that succesfully creates an instance of JVM using the call above?
Thank you for your answer. It indeed solved part of the problem after I
moved the code for checking the exception after the result check.
void TSJavaLib::InitializeJNI()
{
cout << "Welcome to test_JavaMethod()" << endl;
cout << "Version: " << GetVersion() << endl;
jint result = -1;
JavaVMInitArgs args;
JavaVMOption options[2];
options[0].optionString = "-Djava.complier=JIT";
char const* clspath = getenv("CLASSPATH");
if (clspath)
{
char* p1 = "-Djava.class.path=";
options[1].optionString = new char[strlen(p1)+strlen(clspath)+1];
strcpy(options[1].optionString, p1);
strcat(options[1].optionString, clspath);
}
else
{
printf("Classpath may not be set for java virtual machine\n");
}
args.nOptions = 2;
args.version = JNI_VERSION_1_4;
args.options = options;
args.ignoreUnrecognized = JNI_TRUE;
/*Create the Java VM*/
std::cout << "About to call JNI_CreateJavaVM" << std::endl;
result = JNI_CreateJavaVM(&jvm_, (void**)&env_, &args);
if ( result == JNI_OK ) // Success
{
printf("JVM Succesfully Created!\n");
}
else
{
fprintf(stderr,"JNI_ERR Unable to create the Java VM %d\n", result);
exit(1);
}
if ( env_->ExceptionOccurred())
{
std::cerr << "Unable to initialize VM" << std::endl;
env_->ExceptionDescribe();
exit(-1);
}
}
- 5
- Why we have to remove unused ImportHello Everyone.
I want to know why we have to remove those unused Import, use
java.util.ArrayList, don't use java.util.*, why we have to do this.
just for good code style ? or ....
Thanks.
Joey.
- 6
- Outputting value of variable during executionI am using word pad to write the java codes.
Suppose i need to find out the value of a certain variable during execution.
What's the best way to do it? I am clueless.
I have many classes in my java program and I don't suppose I have to pass a
Label member to each class constructor, just to output the class variable to
the Label.
btw, in VC++, I may just use a messagebox to show the value, simply.
Hope I am clear. Thanks.
Regards,
Newbie
- 7
- How many JRE versions are OK?I have a 2 year old HP notebook running XP HE that has two versions,
1.3.1_03
1.4.2
of the JRE installed on it, and I have two questions.
1. The older version was installed when I bought the
notebook, and the
1.4.2 version was installed when I installed
StarOffice. Is there any
reason to keep the older version, or should I
un-install it? I do not know which app, if any, uses this older version.
2. A new application that I use, wants to install a
slightly newer
version,
1.4.2_03
How should I do this, i.e. should I un-install either
or both of the
older installed versions first or install a third
version? FYI, the
installed 1.4.2 version does not have an Update tab.
I noticed that some info at
http://mindprod.com/jgloss/flipping.html
suggested that more than version should not be installed. My guess is
that StarOffice will work with something newer, i.e. 1.4.2_03 or even
1.5.1.
Thanks,
Anthony
- 8
- What is application server?As Roedy already mentioned, an Application Server is a container to host
some kind of component technology, be it JSP, Servlets, EJBs etc. The
application server is often called a 'container' - some types of components
are dependent on a container - for example, you can't run an Session EJB
outside of an Application Server, it most be hosted on an Application Server
to provide any use and to be invoked by a client.
An application server also usually provides you with middleware
functionality and services, which although you could develop yourself (if
you have the knowledge and experience to do so), usually you would use an
application server because it provides these additional service for you.
Services such as security, data persistence, transaction support, high
availability and reliability through features such as server clustering and
failover (if one server goes down another picks up the slack), load
balancing, messaging...
- these are all features that you may find provided by an application
server.
Whether your application needs these services may help you decided whether
you should be using an application server or not.
Hope that helps,
--
Kevin Hooke
MindBeans Software Consulting
http://www.mindbeans.net
- 9
- 10
- New To Java , I'm Stuck , Please Help!Hello,
I just started JAVA @ the university Level and as the semester is
coming to a close , the last assignment is proving to be tough for me
and I would greatly appeciate any help solving my problem. Anyways
this is the assignment,
"Write a program in JAVA that allows the user to input 5 ints. The
program will then output these five values in reverse order. The
program will then output the values in order with a statement on how
many of the remaining values are larger, smaller, or equal.
Example 1:
Input:
1
2
3
4
5
Output:
5
4
3
2
1
1 - 4 larger, 0 smaller, 0 equal
2 - 3 larger, 2 smaller, 0 equal
3 - 2 larger, 2 smaller, 0 equal
4 - 1 larger, 3 smaller, 0 equal
5 - 0 larger, 4 smaller, 0 equal
"
Ok so basically I have got everything up to the reverse order working ,
I even have the final loop set up which goes through the array and
formats the output to appear like this
"
[0] - 0 larger, 0 smaller, 0 equal
[1] - 0 larger, 0 smaller, 0 equal
[2] - 0 larger, 0 smaller, 0 equal
[3] - 0 larger, 0 smaller, 0 equal
[4]- 0 larger, 0 smaller, 0 equal
I can't figure out how to get the larger, smaller, equal part to work
and I've tried for many hours=S I'll post what I have so far.
import java.util.*;
public class ReverseOrder
{
public static void main (String[] args)
{
int larger = 0;
int smaller = 0;
int equals = 0;
Scanner scan = new Scanner (System.in);
int[] numbers = new int[5];
int[] check = new int[5];
for(int index=0; index < numbers.length; index++)
{
System.out.print ("Enter Number" + (index+1) + ":");
numbers[index] = scan.nextInt();
check[index] = numbers[index];
}
System.out.println ("The numbers in reverse order:");
for (int index=numbers.length-1; index >= 0; index--)
{
System.out.print (numbers[index] + " " + "\n");
}
for(int index=0; index < numbers.length; index++)
System.out.print (numbers[index] + " " + " Smaller " +
(smaller) + " Larger " + (larger) + " Equals " + (equals) + "\n");
}
}
Please let me know if you can help because I'm getting a major
headache! Thanks for your time.
Nick
- 11
- Java and Windows.Does anyone know if there is an easy way in java to check and see if a
user has locked there computer?
- 12
- Level of Detail problem <<<< fixed!dont worry, I found the problem. of course, I was doing something as
stupid as setting the col value as the row value and vice versa
well there went my day anyway :)
Ned
Ned Letcher wrote:
> Hi,
>
> I'm currently working on a project for uni which involves creating a
> simple landscape that utilises level of detail. I've attempted to do
> this in what seems to be the standard way: by dividing the model up into
> segments and having a distanceLOD and Switch object for each segment,
> and then having different resolutions of the segment in the Switch. My
> problem is that during navigation there is definitely level of detail
> stuff happening but it is not acting the way it is meant to: it seems to
> behave correctly when I approach the corner that the model was populated
> from - the corner segment and segments in the close vicinity change
> resolution depending on how close I get - however when I move far away
> enough from the corner all level of detail activity halts and everying
> seems to be rendered in the lowest resolution.
>
> Upon further inspection (by completely omitting certain resolutions from
> the Switch) I noted that theres does seem to be a centre of good
> resolution surrounded by poorer resolotion that moves arround the model
> in respnse to my navigation - however it is not oriented with the view
> in the centre, instead I can observe the changes from afar; so when I
> move forward, I see in the distance this patch of good resolution moving
> in a certain direction, and when I move backards, the patch moves in the
> reverse of the previous direction.
>
>
> After seeing this, I had a look at the way the non-segment-omitted code
> behaved around the first corner of the model again and noted that even
> just around that corner, it didnt behave perfectly: certain segments
> would flip sooner than adjacent segments which were actually closer to
> the the view.
>
> Could it be that the LOD is working but just not in respect to the view?
> At the moment my navigation is done using the KeyNavigationBehaviour
> utility - could this cause a problem?
>
> I thouhgt I'd implemented the LOD behaviour exactley the way I had seen
> other people do it, andI've looked everywhere for an explanation of
> what's going on with my program, any help at all would be muchly
> appreciated.
>
> Thanks,
> Ned
- 13
- 14
- Heap dump on OutOfMemoryErrorHi,
Is there any parameter that says to JVM to make a heap dump (objects)
on OutOfMemoryError? I've tried to use -Xrunhprof with :net= option,
but application becomes unacceptable slow. I need something that works
without invocation of JVMPI and makes dump only when exception occurs.
Thanks and Regards,
Dmitry
- 15
- EspressReport?Anyone having any experience with EspressReport from Quadbase?
Is it as good as it looks?
Regards,
BTJ
|
|
|