JavaFX 2 0 Introduction by Example Expert S Voice in Java Dea Carl PDF Download
JavaFX 2 0 Introduction by Example Expert S Voice in Java Dea Carl PDF Download
https://textbookfull.com/product/javafx-2-0-introduction-by-
example-expert-s-voice-in-java-dea-carl/
https://textbookfull.com/product/javafx-9-by-example-dea/
https://textbookfull.com/product/beginning-java-with-websphere-
expert-s-voice-in-java-janson-robert-w/
https://textbookfull.com/product/beginning-jsp-jsf-and-tomcat-
java-web-development-expert-s-voice-in-java-2-new-edition-zambon-
giulio/
https://textbookfull.com/product/beginning-database-driven-
application-development-in-java-ee-using-glassfish-expert-s-
voice-in-open-source-vasiliev-yuli/
Beginning Java and Flex Migrating Java Spring Hibernate
and Maven Developers to Adobe Flex Expert s Voice in
Web Development Di Pisa Filippo
https://textbookfull.com/product/beginning-java-and-flex-
migrating-java-spring-hibernate-and-maven-developers-to-adobe-
flex-expert-s-voice-in-web-development-di-pisa-filippo/
https://textbookfull.com/product/java-7-recipes-a-problem-
solution-approach-juneau-josh-beaty-mark-dea-carl-guime-freddy-
oconner-john/
https://textbookfull.com/product/javaserver-faces-introduction-
by-example-juneau-josh/
https://textbookfull.com/product/pro-hibernate-and-mongodb-the-
expert-s-voice-leonard-anghel/
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
iii
Introduction
JavaFX 2.0 is Java’s next generation graphical user interface (GUI) toolkit for developers to rapidly build
rich cross-platform applications. Built from the ground up, JavaFX takes advantage of modern GPUs
through hardware-accelerated graphics while providing well-designed programming interfaces enabling
developers to combine graphics, animation, and UI controls. The new JavaFX 2.0 is a pure Java language
application programming interface (API).
The key architectural strategies provided by JavaFX 2.0 API are the reuse of existing Java
libraries and the bridging of communication between other languages that run on the JVM (Visage,
Jython, Groovy, JRuby, and Scala).
Nandini Ramani of Oracle plainly states the intended direction of JavaFX the platform in the
following excerpt from the screencast, Introducing JavaFX 2.0:
—Nandini Ramani
Oracle Corp.
VP of Development, Java Client Platform
Some History
In 2005, Sun Microsystems acquired the company SeeBeyond, at which a certain software engineer by
the name of Chris Oliver created a graphics-rich scripting language known as F3 (Form Follows
Function). F3 was later unveiled by Sun Microsystems at the 2007 JavaOne conference as JavaFX.
On April 20, 2009 Oracle Corporation announced the acquisition of Sun Microsystems, making
Oracle the new steward of JavaFX. At JavaOne 2010, Oracle announced the JavaFX roadmap. As part of
the road map, Oracle revealed its plans to phase out the JavaFX script language and re-create JavaFX for
the Java language and platform.
As promised based on the 2010 roadmap, JavaFX 2.0 SDK was released at JavaOne October 3,
2011. Oracle also announced its commitment to take steps to release JavaFX as an open-source product,
thus allowing the community to help move the platform forward. Open-sourcing JavaFX will increase its
adoption, enable a quicker turnaround time on bug fixes, and generate new enhancements.
Table 0-1 shows the overall history of the major JavaFX releases.
xiii
INTRODUCTION
February 12, 2009 1.1 Windows and MacOS New mobile development
April 22. 2010 1.3 Windows, MacOS, Linux, JavaFX Composer, TV Emulator,
Solaris Mobile Emulator
October 3, 2011 2.0 Windows, MacOS Rewritten for the Java Language
xiv
INTRODUCTION
References
Following are some online resources that will prove helpful as you begin your journey:
Introducing JavaFX 2.0, by Nandini Ramani:
http://medianetwork.oracle.com/video/player/1191127359001
Chris Oliver's weblog: http://blogs.oracle.com/chrisoliver/entry/f3
JavaFX Roadmap: http://javafx.com/roadmap/
OpenJDK Discussion About JavaFX, by Richard Bair: http://fxexperience.com/2011/10/openjdk-
discussion-about-javafx/
JavaFX on Wikipedia: http://en.wikipedia.org/wiki/JavaFX
xv
CHAPTER 1
JavaFX Fundamentals
The JavaFX 2.0 API is Java’s next generation GUI toolkit for developers to build rich cross-platform
applications. JavaFX 2.0 is based on a scene graph paradigm (retained mode) as opposed to the
traditional immediate mode style rendering. JavaFX’s scene graph is a tree-like data structure that
maintains vector-based graphic nodes. The goal of JavaFX is to be used across many types of devices
such as mobile devices, smartphones, TVs, tablet computers, and desktops.
Before the creation of JavaFX, the development of rich Internet applications (RIAs) involved the
gathering of many separate libraries and APIs to achieve highly functional applications. These separate
libraries include Media, UI controls, Web, 3D, and 2D APIs. Because integrating these APIs together can
be rather difficult, the talented engineers at Sun Microsystems (now Oracle) created a new set of JavaFX
libraries that roll up all the same capabilities under one roof. JavaFX is the Swiss Army Knife of GUIs (see
Figure 1-1). JavaFX 2.0 is a pure Java (language) API that allows developers to leverage existing Java
libraries and tools.
Depending on who you talk to, you will likely encounter different definitions of “user experience”
(or in the UI world, UX). But one fact still remains; the users will always demand better content and
increased usability from GUI applications. In light of this fact, developers and designers often work
together to craft applications to fulfill this demand. JavaFX provides a toolkit that helps both the
developer and designer (in some cases, they happen to be the same person) to create functional yet
esthetically pleasing applications. Another thing to acknowledge is that if you are developing a game,
media player, or the usual enterprise application, JavaFX will not only assist in developing richer UIs but
you’ll also find that the APIs are extremely well designed to greatly improve developer productivity (I’m
all about the user of the API’s perspective).
Although this book doesn’t go through an exhaustive study of all of JavaFX 2.0’s capabilities, you will
find common use cases that can help you build richer applications. Hopefully, these recipes can lead
1
CHAPTER 1 JAVAFX FUNDAMENTALS
you in the right direction by providing practical and real-world examples. I also would like to encourage
you to explore other resources to gain further insight into JavaFX. I highly recommend the book Pro
JavaFX Platform (Apress, 2009) and the soon to released Pro JavaFX 2.0 Platform (Apress, 2012), which is
an invaluable resource. These books go in depth to help you create professional grade applications.
So without further ado, let’s get started, shall we?
Solution
You’ll need to install the following software in order to get started with JavaFX:
• Java 7 JDK or greater
• JavaFX 2.0 SDK
• NetBeans IDE 7.1 or greater
Note As of this writing, things are subject to change. To see additional requirements, refer to
http://download.oracle.com/javafx/2.0/system_requirements/jfxpub-system_requirements.htm.
As of this writing, things are subject to change. By the time you read this; you will likely find JavaFX
able to run on your favorite OS. For this recipe, I assume that Java 7 is already installed so I won’t detail
those installation steps. Following are steps to install all other required software components:
1. Download JavaFX 2.0 and NetBeans IDE 7.1.x from the following locations:
• JavaFX 2.0 SDK:
http://www.oracle.com/technetwork/java/javafx/downloads/index.html
• NetBeans 7.1 beta SDK: http://netbeans.org
2. Install JavaFX 2.0 SDK. The screen in Figure 1-2 will appear once you’ve
launched the JavaFX SDK Setup executable.
Once you have launched the JavaFX SDK setup executable you will see the start of the wizard in
Figure 1-2.
2
CHAPTER 1 JAVAFX FUNDAMENTALS
3. Next, you can specify the home directory of the JavaFX SDK by clicking the
Browse button. Figure 1-3 shows the default location for the JavaFX SDK’s
home directory. You might want to jot this location down in order to configure
your CLASSPATH in Step 6.
Figure 1-3 displays Setup Options, which allow you to specify the JavaFX 2.0 SDK’s home directory.
3
CHAPTER 1 JAVAFX FUNDAMENTALS
4. After you click Next, the components will install and the screen shown in
Figure 1-4 will appear.
Figure 1-4 displays the progress indicator installing the last components before completing.
5. Install the NetBeans IDE, which includes the JavaFX 2.0 plug-in.
When installing, you will follow the default wizard screens. For additional instructions, you may
refer to http://netbeans.org/community/releases/71/install.html.
6. Configuring your environment variable CLASSPATH to include the JavaFX
runtime library. The name and location of the runtime library is at <JavaFX SDK
Home directory>\rt\lib\jfxrt.jar. (Linux uses the forward slash: /).
How It Works
This recipe shows how to install Java FX 2.0 and the NetBeans IDE onto the Windows platform. You may
need to modify your steps slightly when installing JavaFX 2.0 on other operating systems as they become
available. Although the steps described here are for NetBeans, you can also develop using other IDEs
such as Eclipse, IntelliJ, or vi. While most of the example recipes were created using the NetBeans IDE,
you can also compile and run JavaFX applications using the command-line prompt.
To compile and run JavaFX applications using the command-line prompt you will need to configure
your CLASSPATH. After you have followed the wizards to install the prerequisite software you will need
to set your environment’s CLASSPATH variable to include the JavaFX runtime library <JavaFX SDK Home
directory>/rt/lib/jfxrt.jar (Step 6). Setting this library will later assist in compiling and running
JavaFX-based applications on the command-line. The following code configures your CLASSPATH
environment variable based on your platform:
4
CHAPTER 1 JAVAFX FUNDAMENTALS
# bash environments
export JAVAFX_HOME=<JavaFX SDK Home>
export CLASSPATH=$CLASSPATH:$JAVAFX_HOME/rt/lib/jfxrt.jar
#csh environments
setenv JAVAFX_HOME <JavaFX SDK Home>
setenv CLASSPATH ${CLASSPATH}:${JAVAFX_HOME}/rt/lib/jfxrt.jar
In recipe 1-2 you will learn how to create a simple Hello World application. Once your Hello World
application is created, you will be able to compile and run a JavaFX-based application.
Solution #1
Develop a JavaFX HelloWorld application using the JavaFX project creation wizard in the NetBeans IDE.
To quickly get started with creating, coding, compiling, and running a simple JavaFX HelloWorld
application using the NetBeans IDE, follow these steps:
Launch NetBeans IDE.
5) Change or accept the defaults for the Project Location and Project Folder fields.
5
CHAPTER 1 JAVAFX FUNDAMENTALS
6) Make sure the Create Application Class check box option is selected. Click Finish.
7) In the NetBeans IDE on the Projects tab, select the newly created project. Open the Project Properties
dialog box to verify that the Source/Binary format settings are JDK 7. Click Sources under Categories.
8) While still in the Project Properties dialog box, under Categories, select Libraries to verify that the Java
7 and JavaFX platform are configured properly. Click the Manage Platforms button. Make sure a tab
showing JavaFX libraries appears. Figure 1-5 depicts the JavaFX tab detailing its SDK home, Runtime,
and Javadoc directory locations. Once verified, click the Close button.
Figure 1-5 shows the Java Platform Manager window containing JavaFX as a managed platform included
with JDK 7.
9) After closing the Java Platform Manager window, click OK to close the Project Properties window.
10) To run and test your JavaFX Hello World application, access the Run menu, and select Run Main
Project or hit the F6 key.
Shown in Figure 1-6 is a simple JavaFX Hello World application launched from the NetBeans IDE.
6
CHAPTER 1 JAVAFX FUNDAMENTALS
Figure 1-6. JavaFX Hello World launched from the NetBeans IDE
Solution #2
Use your favorite editor to code your JavaFX Hello World application. Once the Java file is created you
will use the command-line prompt to compile and run your JavaFX application. Following are the steps
to create a JavaFX Hello World application to be compiled and run on the command-line prompt.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
/**
*
* @author cdea
*/
public class HelloWorldMain extends Application {
7
CHAPTER 1 JAVAFX FUNDAMENTALS
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World");
Group root = new Group();
Scene scene = new Scene(root, 300, 250);
Button btn = new Button();
btn.setLayoutX(100);
btn.setLayoutY(80);
btn.setText("Hello World");
btn.setOnAction(new EventHandler<ActionEvent>() {
3. Compile the source code file HelloWorldMain.java using the Java compiler javac:
javac -d . HelloWorldMain.java
4. Run and test your JavaFX Hello World application. Assuming you are located in the same directory as
the HelloWorldMain.java file, type the following command to run your JavaFX Hello World application
from the command-line prompt:
java helloworldmain.HelloWorldMain
Shown in Figure 1-7 is a simple JavaFX Hello World application launched from the command-line
prompt.
8
CHAPTER 1 JAVAFX FUNDAMENTALS
Figure 1-7. JavaFX Hello World launched from the command-line prompt
How It Works
Following are descriptions of the two solutions. Both solutions require prerequisite software. (I cover
how to install required software in recipe 1-1.) In Solution #1 you will be creating a JavaFX application
using the NetBeans IDE. Solution #2 allows you to choose your favorite editor and use the command-
line prompt to compile and execute JavaFX programs.
Solution #1
To create a simple JavaFX Hello World application, using the NetBeans you will use the JavaFX project
creation wizard as specified in Steps 1 through 7. In Steps 8 through 10, you will verify two settings to
ensure that the project is configured to compile and run JavaFX 2.0 applications properly. Finally, in
Step 11 you will run the JavaFX Hello World application by selecting the Run Main Project menu option.
You shouldn’t encounter any difficulty when following Steps 1 through 7. However, Steps 8 through
10 address a minor NetBeans bug that has to do with setting your project source/binary format to JDK 7
and making sure that the managed platform includes the JavaFX runtime libraries. If you are not
experiencing this issue, the NetBeans team may have already corrected the problem. To be on the safe
side, it wouldn’t hurt to follow Steps 8 through 10 to verify your configurations before you begin.
Solution #2
To create a simple JavaFX Hello World application using your favorite IDE, follow Steps 1 and 2. To
compile and run your Hello World program on the command line, follow Steps 3 and 4.
Once the source code is entered into your favorite editor and the source file has been saved, you will
want to compile and run your JavaFX program. Open the command-line prompt window and navigate
to the directory location of the Java file named HelloWorldMain.java.
Here I would like to point out the way you compile the file using the command javac -d .
HelloWorldMain.java. You will notice the -d . before the file name. This lets the Java compiler know
where to put class files based on their package name. In this scenario, the HelloWorldMain package
statement is helloworldmain, which will create a subdirectory under the current directory. When finished
compiling, your directory structure should resemble the following:
9
CHAPTER 1 JAVAFX FUNDAMENTALS
|projects
|helloworld
|HelloWorldMain.java
| helloworldmain
|HelloWorldMain.class
With the preceding directory structure in mind, the following commands will compile and run our
JavaFX Hello World application:
cd /projects/helloworld
javac –d . HelloWorldMain.java
java helloworldmain.HelloWorldMain
Note There are many ways to package and deploy JavaFX applications. To learn more, please see “Learning
how to deploy and package JavaFX applications” at
http://blogs.oracle.com/thejavatutorials/entry/javafx_2_0_beta_packager. For in-depth JavaFX
deployment strategies, see Oracle’s “Deploying JavaFX Applications” at
http://download.oracle.com/javafx/2.0/deployment/deployment_toolkit.htm.
In both solutions you’ll notice in the source code that JavaFX applications extend the
javafx.application.Application class. The Application class provides application life cycle functions
such as launching and stopping during runtime. This also provides a mechanism for Java applications to
launch JavaFX GUI components in a threadsafe manner. Keep in mind that synonymous to Java Swing’s
event dispatch thread, JavaFX will have its own JavaFX application thread.
In our main() method’s entry point we launch the JavaFX application by simply passing in the
command line arguments to the Application.launch() method. Once the application is in a ready state,
the framework internals will invoke the start() method to begin. When the start() method is invoked,
a JavaFX javafx.stage.Stage object is available for the developer to use and manipulate.
You’ll notice that some objects are oddly named, such as Stage or Scene. The designers of the API
have modeled things similar to a theater or a play in which actors perform in front of an audience. With
this same analogy, in order to show a play, there are basically one-to-many scenes that actors perform
in. And, of course, all scenes are performed on a stage. In JavaFX the Stage is equivalent to an application
window similar to Java Swing API JFrame or JDialog. You may think of a Scene object as a content pane
capable of holding zero-to-many Node objects. A Node is a fundamental base class for all scene graph
nodes to be rendered. Commonly used nodes are UI controls and Shape objects. Similar to a tree data
structure, a scene graph will contain children nodes by using a container class Group. We’ll learn more
about the Group class later when we look at the ObservableList, but for now we can think of them as Java
Lists or Collections that are capable of holding Nodes.
Once the child nodes have been added, we set the primaryStage’s (Stage) scene and call the show()
method on the Stage object to show the JavaFX window.
One last thing: in this chapter most of the example applications will be structured the same as this
example in which recipe code solutions will reside inside the start() method. Having said this, most of
the recipes in this chapter will follow the same pattern. In other words, for the sake of brevity, much of
10
Another Random Scribd Document
with Unrelated Content
skrattfägnad. När det slutligen kom till cigarrfodralet voro vittnena
fullkomligt sadelfasta och veko ej en tum.
»Hvad säger nu åklagarn själf om denna historia?» lät domarn
snäft. »Två vittnen ha yttermera återfunnit ett åklagarn tillhörigt
cigarr-etui i ladan!»
Nu begrep en hvar till fullo, att länsman kunde hälsa hem, men
här var ej annan råd än se morsk ut. Det käcka svaret kom, mött af
allmänt löjessorl:
»Jag yrkar högsta ansvar enligt lag på denna karl för hans
missfirmelse inför rätta. Här har ju två vittnen sett karlen kånka
något liknande ett får...»
»Och det fåret var tydligen allmänna åklagaren själf!» afbrände
domarn. »Att komma och traggla med dylikt elände till åtlöje för
ordningsmakten! Karln har tydligen velat hålla tyst med allt... i
någon slags grannlagenhet eller rädsla för åklagaren, hvars lefverne
för öfrigt är en känd visa i orten. — Ha parterna några
slutpåståenden?»
»Joho,» svarade Larslund så kvickt, »si jag hade nog tänkt hasa
efter den här rika karln, som tjyfstämde mig. Jaha, si, får jag inte ut
min förlikning, så...»
Stor-Elias blef vid denna vändning märkbarligen riktigt het om
öronen. Saken kunde möjligen gå lös på fästningsarbete och i all
hjärtängslan började han framsnörfla:
»Må se, må se! Jag vill allernådigast och gunstbenäget insinuera
hos den underdåniga och vällofliga häradsrätten, att, eftersom jag
tydligen hafver hoppat i galen tunna, mig må förunnas tillfälle att här
å tingsstället med Larslund konferera om en skälig förliknings
ingående och sedermera under dagen instrumentet häröfver ingifva.
Må se, må se, jaha, si detta är mitt gunstbenägna yrkande.»
Detta bifölls och parterna afträdde, åklagaren och Stor-Elias med
minen hos dem, som ätit upp nådeåret för räfven, Larslund med en
from suck, ett litet plirande illflin. Och vid de fryntliga minerna hos
de många omstämda fienderna framhuttrade han:
»Joho, go’ vänner, si så där går det för dem ogudaktigom. Om jag
ändå inte hade bedt och förmanat dem så innerligen att ta sig till
vara! Till det öfriga ska’ ni mest få se, att jag nog får mig ut en liten
bra förtjänst på det här!»
V.
Slutet.
Larslund dyr vid förlikningen.
Sist återstår, huru den store smulgråten Larslund, med den gladt
skinande Strandman vid protokollet, satt i vittnenas rum bland en
skara åhörare och tog ut sin förlikning af Stor-Elias. Detta blef en
minnesvärd historia.
»Si, det har nog skridit efter för mig så bedröfligt i dessa tider,»
började Larslund med sitt långsäfliga gnäll under aningsfullt skratt i
laget. »Så att först vill jag nu ha mig ut en tusen riksdaler nu då,
förstås.»
»Det var mig en fördärfvad tomhund!» utbrast Stor-Elias ända
öfver sig på rent landsmål.
»Och se’n så vill jag nog, förstås, ha ut bakre hälften af storgrisen
eran nu till jul. Jag har nog hört, att ni ha en bra storgris. Så att jag
vill nog ha ut bakre hälften af grisen, förstås, jaha... och så alla fyra
föttren, förstås!»
»Ska’ inte Larslund ha ut rumpskrufven också?» undrade en
åhörare under allmän skrattsalfva. Larslund låtsade ej höra de
ogudaktiges begabberi utan gnällde vidare helt oberörd:
»Så vill jag nog ha mig ut en riktigt rejäl skrufnafvare, förstås. Och
se’n så behöfver jag nog få mig ut en ny gråvadmalsrust.»
»Jaja, den som köper korfven af hunn, får nog ge’en smöret för
bara korfstickan,» fick Stor-Elias fram, redan svettig af ångest.
»Och sedan vill jag nog ha mig ut tolf mark korf och ett pund
smör!» kvitterade Larslund något illflinande och nästan dränkt af
skrattet. »Och så vill jag nog ha mig ut ett par stora och rejäla
knästöflar och så fem skålpund ister att smörja dem med; äfvenså
en branog rejäl oxhud ska’ jag förstås ha ut.»
»Det var mig den värsta tomhund!» våndades Stor-Elias. »Låt’et
nu vara slut en gång, människa!»
»Ni lär ju ha bra utaf lin,» ylade Larslund, döf och blind. »Så att
jag vill nog ha mig ut en fem pund lin. Och ull ha ni; så att jag vill
nog ha mig ut en tolf mark ull; si strumporna mina ä’ mest slut och
den ull, som blir öfver, kan jag nog afyttra, förstås.»
»Börja nu på och ge sig, Larslund!» sorlade åhörarne mangrant.
»Nej, tiggarn som kommer på häst, han rider nog helst i sträck,»
framslängde offerbocken med stora svettdroppar i pannan.
»Och så kom jag just i håg, att jag vill nog ha mig ut en bra
fotsack och två selapinnar.»
»Tag en hel tunna på en gång, Larslund!» manade ett kvickhufvud
under fördränkande åtlöje.
»Och så vill jag nog ha mig ut en tunna strömming nu till jul, och
en mark hundister för min sjuka mage; jag har hört, att ni ha rejält
hundister. Hundra knäckebröd, få ni bära hem åt mig, förstås, och en
lax ska’ jag nog ha ut till nästa midsommar, förstås. Ett grenljus få ni
ge mig nu till jul och en tolft tjockkakor. Lutfisken ska’ jag också ha:
ett halft pund lutfisk, så att det räcker nå’n tid. Sedan så behöfver
jag nog en tolf famnar ved; ett par nya trygor få ni nog ge mig. Och
så, ja ge mig nu si...»
Stor-Elias gaf de obehöriga en vink att tiga, ty allt deras gäckeri
ledde endast tomhunden till nya ingifvelser.
»Joho, si jag skulle nog ha mig ut en tre hundskinn för att laga
hundskinnspälsen min,» ihågkom Larslund. »Och så skulle jag nog
ha mig ut en tunna strömming...»
»Men Larslund har ju redan tagit ut en tunna!» påminde alle man.
»Jaha, si då säg’ jag väl två tunnor nu då, så att jag vill nog ha ut
två tunnor strömming på det viset,» långgnällde Larslund och Stor-
Elias utbröt förbittrad:
»Här stå ni bara och hjälper snålhunden här ideligen på trafven!»
»Och så ge mig nu vidare si,» sa’ Larslund, oberörd af skämt och
allvar, pressade långsamt sin tröga eftertanke och framgnällde
slutligen:
»Joho, si det var så rätt! Si Herren lofte mig alldeles nyss, då jag
stod i min begrundan, att jag äfvenså skulle ha mig en tolft
mjukkakor. Jaha, och så en riktigt bra’en fäll...»
Jag vet icke rätt, om Larslund hunnit uppräkna sina fordringar
ännu i den stund, då detta skrifves.
INFÖR DE TRE EXCELLENSERNAS
DOMSTOL
MINNE FRÅN TROLLDOMSRÄFSTERNAS
DAGAR
I.
Järker-Mäldare.
Det är nu åtskilligt mer än tvåhundra år sedan en formlig skräck
uppstod öfver vida Norrland för det yttersta mörkrets gränslösa
tyranni, som i sällsamma klagomål till öfverheten erkändes hafva
öfverskridit alla tillbörliga gränser.
Till andra vittnesbörd därom hörde äfven följande sak.
Någonstädes på den ångermanska nordanälfssidan lefde Järker-
Mäldare med sin barnlösa hustru i backstugan.
Nere i skogsdäldens djup, vid vattenfallet, hade han en kvarn, som
en tid skickat sig likt andra kvarnar och malt säd åt både ond och
god.
Men denna jämlikhet upphörde, när hjul och stenar en vacker dag
ej rördes för säd åt ockraren Peder Bröm, som i sådan måtto syntes
träffad af gudshanden.
Nu skulle man kanske frestas tro, att den rättsinniga kvarnen blef i
tillbörlig ära hållen och öfverlupen af mäld. Men det blef icke
händelsen.
Skrämda kunder förde icke mera dit en påse. De lade säkert hand
vid egen barm och mindes nog, att icke en rättfärdig finnes.
När så den arme Järker såg sin näring all tillspillogifven, då hörde
han en stämma ropa så ur kvarnen:
»Tre raska piltar skall du få att draga hop din ålders födoråd!»
Ett år vid lag gick om och dödfödd kom till världen Järkers första
son.
Fadren fann ej skäl att söka prästens läsning, som till döden skulle
viga hvad som ännu icke smakat lifvet. När han då på skogen
jordade med sonen det besvikna fadershoppet, sade han i bitter ton:
»När du hvilat dig i åren sju, så kan du stiga upp och tigga mat åt
far din!»
Tre år förgingo.
Andra sonen föddes också död till världen.
Då fadern jordat honom vid den förstes sida, sade han med sorg i
tonen:
»Då du kommer dig i tiggaråren, så kan du stiga upp och hjälpa
brodern dra hem hans börda.»
Fem års tid vid pass gick ännu om. Då föddes tredje sonen, men
ej med mera lif än de första två. Vid hans graf i brödrens rad föllo
fadrens ord som så:
»Den hjälp jag skulle få af dina bröder blef nog snöd. Tag rätt på
dem, så vidt du kan, och hjälps åt alla tre att skaffa mat till gårds!»
Tiden gick, men inga söner föddes mer i torpet.
II.
Rike-Järker.
Hvad åren ledo, spordes allmänt tal, att Järker, arme mäldarn, gick
ej längre med tiggarpåsen ned åt bygden, snörd i svältrem.
Nej, alla visste nu berätta, att han tog sitt matbehof från
farstusvalen ur ett tretal aldrig tömda strytor, som stodo bakom
dörren där och aldrig fylldes på af honom själf[1].
Rättnu blef han karl att återgälda hjälp och hjälpa andra, blef
välburgen, rik och snart en mäktig man i orten.
Men det fanns folk, som länge skådat ned i egna strytor för att där
förklara Järkers välstånd.
Och hvad de sågo, det var idel minskning!
De gingo så till länsman, men denne vän åt Rike-Järker brydde sig
ej om den saken.
Så hade någon skarpsynt gumma märkt, att Järkers svale hade
trenne gluggar, en vid hvarje stryta.
Saken blef anmäld för länsman, men han, den Rike-Järkers vän,
lät saken vara.
Då lade sig två grannar en natt på spaning i skogsbrynet strax vid
Järkers stuga. Mycket riktigt sågo de med långa mellanrum tre
nissar, som i röda lufvor kommo utför stigen, tömde sina påsar
hastigt genom hvar sitt sprund och styrde färden sedan genom
torpet bort mot andra sidan, den minste först, den medelvuxne
därnäst och den störste sist i raden, såsom skäligt var med skilda
åldrars flinkhet.
När den saken blef anmäld för länsman, då kunde han, så vän han
var med Rike-Järker, icke längre låta saken vara.
I dryckeslag på tu man hand förde han på tal den frågan, huru
Järker blifvit riker karl.
»Ja, om du detta finge veta, skulle byxen falla af dig med
detsamma,» lydde svaret.
»Nå, men huru då?» ville länsman veta.
»Ja, du skall tro, att lathundarna deras kommo alla tre en natt,
den ena före och den andra efter, ville hafva ledigt på
skärtorsdagskväll, kröpo såsom maskarne, du vet, och bådo...»
»Nå hvad sade du?»
»Jag sade som så, att om de måste dra till gårds, så var det bara
deras skyldighet, förstås, och därmed jämt!»
Dagen därpå, efter kort samråd med själaherden, måste länsman
gå däran och häkta Rike-Järker.
Så kom han in för kyrkorådet, men de hade ingen råd med honom
där.
Han inställdes sedan för lagläsarn och tingsrätten men de hade
ingen råd med honom där.
Omsider fick han stå till svars för själfve doktorn och kapitlet, men
det synes tydligt att de icke heller funno någon råd med honom där.
Och Järker måste då, när allt kom vida, få sin frihet åter, blef med
dagarna allt mera fruktad, rik och oåtkomlig.
Men hans öde hängde öfver honom och hvad tiden led kom dag
och stund för råd med honom äfven.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com