Class SwingExamples
java.lang.Object
net.jrodolfo.java_evolution.java02.swing.SwingExamples
Demonstrates headless-safe Swing concepts from the Java 2 platform.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintTriggers a Swing action through a button model without showing a window.Uses Swing's list model without creating a visible list component.booleanRuns code on Swing's Event Dispatch Thread (EDT).Uses Swing's table model as a data model separate from visible rendering.
-
Constructor Details
-
SwingExamples
public SwingExamples()
-
-
Method Details
-
listModelSnapshot
Uses Swing's list model without creating a visible list component.- Returns:
- ordered snapshot of model values
-
tableModelValue
Uses Swing's table model as a data model separate from visible rendering.- Returns:
- value stored in the first table row
-
buttonActionClicks
public int buttonActionClicks()Triggers a Swing action through a button model without showing a window.- Returns:
- number of times the action was invoked
-
runsOnEventDispatchThread
Runs code on Swing's Event Dispatch Thread (EDT).- Returns:
truewhen the callback ran on the EDT- Throws:
InvocationTargetException- when the callback failsInterruptedException- when interrupted while waiting for the EDT
-