I don't know of an example offhand, but this code snippet should help...
public class MyApplet extends JApplet
{
public void init()
{
...
}
public static void main( String[] args )
{
// construct and initialize applet
final MyApplet applet = new...
Hi All,
This is a tricky one, or so it seems to me after a while of battling with Graphics2D, Graphics, double buffered images, and the like. Basically, I've got a double-buffered image as a background for a JFrame, and I want to paint some swing components onto the JFrame as well, on top of...
Here's an interesting problem to which I haven't been able to come up with an intelligent solution:
I need to display months of a Calendar in a JSP or the like. What is a good way to get a list of which days are valid for a particular month? And how can I determine which day of the week...
Typically, when you are validating user input in Java, you will want to check for both null and empty string values. To check String objects for equality, you must use the .equals() method (not the == operator). Thus, a check for an empty String value might look something like this:
if (...
Hi All,
Anyone have experience using JAAS to authenticate against an NT Domain controller? I've checked out the API docs and such, but haven't been able to piece together a simple solution... something like how linar's jintegra works is what I'm looking to do. That is, pass a domain...
Hi Ankur,
The secret here is to use the correct layout managers in your application. You need to set things up so that if and when the window is stretched or shrunk, your components will all resize and will not be eliminated by the shrinking window.
You may also need to determine the...
Hi kishorecvr,
There are a few ways to package EJBs, depending on the app server that you are deploying them on. For example, if you are deploying on JBoss, you can simply use the jar tool that comes with the SDK to compile your EJB jars. However, if you are using WebLogic, you need to run...
Sorry... I guess I forgot to address the risks/issues associated with prepared statements. Essentially, they are useful because the SQL is compiled only once and is then cached on the database server. Thus, if you are repeatedly using the same queries, they should provide a performance...
Hi Themuppeteer,
I think what you're going to want to use here is a custom document that will get attached to your text field. I've done this before for a date input field, and although it's kind of tricky, it's definitely do-able.
Create an IPDocument that extends PlainDocument. You'll want...
Hi All,
Does anyone have experience setting up a configuration file for a logging mechanism implemented using JDK1.4? Sadly, the API documentation says little to nothing about how to set up the config file.
What I'm basically trying to do is to set up a default logging level (say WARNING) for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.