¡@

Home 

java Programming Glossary: demo

Is there any way to accept only numeric values in a JTextField?

http://stackoverflow.com/questions/1313390/is-there-any-way-to-accept-only-numeric-values-in-a-jtextfield

with some code quite some code actually . First the small demo application. This application just shows a JFormattedTextField..

How to really read text file from classpath in Java

http://stackoverflow.com/questions/1464291/how-to-really-read-text-file-from-classpath-in-java

class Test This code is nasty and not exception safe. Just demo code public static void main String args throws Exception InputStream..

Can't transparent and undecorated JFrame in JDK7 when enabling nimbus

http://stackoverflow.com/questions/16219111/cant-transparent-and-undecorated-jframe-in-jdk7-when-enabling-nimbus

public static void main String args create a new demo and update it every 50 mSec new Timer 30 new DemoWindows .start.. 50 mSec new Timer 30 new DemoWindows .start int phase 0 demo runs a number of consecutive phases int count 0 each of which.. number of timesteps JFrame window1 new JFrame Java windows demo JLabel text1 new JLabel HTML H1 Hello BR Everyone HTML H1 This..

Choosing a Java Web Framework now? [closed]

http://stackoverflow.com/questions/2084169/choosing-a-java-web-framework-now

both survive . I can't say much about Play. I've seen the demo like everybody but I would like to read real life feedback...

What is difference between “Class.forName()” and “Class.forName().newInstance()”?

http://stackoverflow.com/questions/2092659/what-is-difference-between-class-forname-and-class-forname-newinstance

class share improve this question Maybe an example demonstrating how both methods are used will help you to understand.. throws Exception Class clazz Class.forName test.Demo Demo demo Demo clazz.newInstance As explained in its javadoc calling..

How to timeout a thread

http://stackoverflow.com/questions/2275443/how-to-timeout-a-thread

String call throws Exception Thread.sleep 4000 Just to demo a long running task of 4 seconds. return Ready Play a bit with.. the sleep is not required. It is just used for SSCCE demonstration purposes. Just do your long running task right there..

Catching java.lang.OutOfMemoryError?

http://stackoverflow.com/questions/2679330/catching-java-lang-outofmemoryerror

How to replace the AWT EventQueue with own implementation

http://stackoverflow.com/questions/3158254/how-to-replace-the-awt-eventqueue-with-own-implementation

to debug is a TableCellEditor which works fine in a little demo app but when put in the real application stopCellEditing gets.. push that will do exactly what you want. Here is a little demo public class QueueTest public static void main String args throws..

Recommended JSF 2.0 CRUD frameworks [closed]

http://stackoverflow.com/questions/3180400/recommended-jsf-2-0-crud-frameworks

you should retrieve the list from DAO. This is just for demo. list new ArrayList Item list.add new Item 1L item1 list.add.. should already have set the ID from DB. This is just for demo. item.setId list.isEmpty 1 list.get list.size 1 .getId 1 list.add..

Send email using java

http://stackoverflow.com/questions/3649014/send-email-using-java

thread.jspa threadID 5205249 smtpsend.java demo program from javamail props.put mail.smtps.quitwait false Session..

Downcasting in Java

http://stackoverflow.com/questions/380813/downcasting-in-java

Is there any practical use for this concept public class demo public static void main String a B b B new A compiles with the..

Why does this go into an infinite loop?

http://stackoverflow.com/questions/3831341/why-does-this-go-into-an-infinite-loop

in the example above I've thrown together a quick demo to illustrate that this intermediate value does indeed exist.. though it will never be seen on the executing thread. The demo calls x x in a loop while a separate thread continuously prints..

How to internationalize a Java web application?

http://stackoverflow.com/questions/4276061/how-to-internationalize-a-java-web-application

DOCTYPE html html lang language head title JSP JSTL i18n demo title head body form select id language name language onchange..

JSF 2.0 File upload

http://stackoverflow.com/questions/5418292/jsf-2-0-file-upload

jsf facelets h head title Tomahawk file upload demo title h head h body h form enctype multipart form data t inputFileUpload..

JFreeChart scaling of Boxplots with several Categories

http://stackoverflow.com/questions/6844759/jfreechart-scaling-of-boxplots-with-several-categories

args throws IOException StretchedBoxAndWhiskerExample demo new StretchedBoxAndWhiskerExample java charts scaling jfreechart.. JFrame.EXIT_ON_CLOSE BoxAndWhiskerDemo demo new BoxAndWhiskerDemo frame.add demo.getChartPanel BorderLayout.CENTER.. BoxAndWhiskerDemo demo new BoxAndWhiskerDemo frame.add demo.getChartPanel BorderLayout.CENTER frame.add demo.getControlPanel..

The Use of Multiple JFrames, Good/Bad Practice?

http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice

displaying many elements in one GUI e.g. CardLayout short demo. . Good for Showing wizard like dialogs. Displaying list tree..

Validate an XML file against local DTD file with Java

http://stackoverflow.com/questions/1096365/validate-an-xml-file-against-local-dtd-file-with-java

the document start and discard any from the old document. Demo usage XMLEventFactory eventFactory XMLEventFactory.newInstance..

What is difference between “Class.forName()” and “Class.forName().newInstance()”?

http://stackoverflow.com/questions/2092659/what-is-difference-between-class-forname-and-class-forname-newinstance

So consider the following class package test public class Demo public Demo System.out.println Hi @SuppressWarnings unchecked.. the following class package test public class Demo public Demo System.out.println Hi @SuppressWarnings unchecked public static.. args throws Exception Class clazz Class.forName test.Demo Demo demo Demo clazz.newInstance As explained in its javadoc..

Java/Swing: low-profile button height?

http://stackoverflow.com/questions/2899935/java-swing-low-profile-button-height

public static void main String args JFrame jf new JFrame Demo jf.getContentPane .setLayout new FlowLayout Ordinary button..

How to use XPath on xml docs having default namespace

http://stackoverflow.com/questions/3939636/how-to-use-xpath-on-xml-docs-having-default-namespace

import org.w3c.dom.NodeList public class Demo public static void main String args DocumentBuilderFactory domFactory.. import org.w3c.dom.NodeList public class Demo public static void main String args DocumentBuilderFactory domFactory..

Using JAXB to cross reference XmlIDs from two XML files

http://stackoverflow.com/questions/5319024/using-jaxb-to-cross-reference-xmlids-from-two-xml-files

import javax.xml.bind.Unmarshaller public class Demo public static void main String args throws Exception JAXBContext..

How to share data with two(2) SwingWorker class in Java

http://stackoverflow.com/questions/6171414/how-to-share-data-with-two2-swingworker-class-in-java

buttonPanel.add button4 frame.setTitle Shaking Button Demo frame.setDefaultCloseOperation JFrame.EXIT_ON_CLOSE frame.setLayout..

Changing the shapes of points in scatter plot

http://stackoverflow.com/questions/6665354/changing-the-shapes-of-points-in-scatter-plot

public SPlotfinal String s super s JPanel jpanel createDemoPanel jpanel.setPreferredSize new Dimension 500 270 setContentPane.. 500 270 setContentPane jpanel public static JPanel createDemoPanel JFreeChart jfreechart ChartFactory.createScatterPlot Scatter.. jfreechart ChartFactory.createScatterPlot Scatter Plot Demo X Y samplexydataset2 PlotOrientation.VERTICAL true true false..

Changing mercury color in thermometer in JFreeChart

http://stackoverflow.com/questions/7597015/changing-mercury-color-in-thermometer-in-jfreechart

dataset final JFreeChart chart new JFreeChart Thermometer Demo 2 chart title JFreeChart.DEFAULT_TITLE_FONT plot plot .. questions 7597015 public class ThermometerDemo extends JPanel private static final int W 200 private static.. int W 200 private static final int H 2 W public ThermometerDemo double value this.setLayout new GridLayout DefaultValueDataset..