Skip to content

Commit eac35bd

Browse files
committed
Rework for use with toolchain beta 2
1 parent 638b239 commit eac35bd

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import PackageDescription
33
let package = Package(
44
name: "examples",
55
dependencies: [
6-
.Package(url: "https://github.com/SwiftJava/javax_swing.git", versions: Version(2,0,0)..<Version(3,0,0)),
6+
.Package(url: "https://github.com/SwiftJava/javax_swing.git", versions: Version(2,1,0)..<Version(3,0,0)),
77
]
88
)

Sources/JComboBox.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AutoComplete: JComboBox
6363
{
6464
// System.out.println(lap)
6565
// Kam nie hier vorbei.
66-
if(cBox.lap + 1000 < now) {
66+
if(Int64(cBox.lap) + 1000 < now) {
6767
cBox.searchFor = "" + aKey
6868
}
6969
else {

Sources/main.swift

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
//
22
// main.swift
3-
// awt2
3+
// examples
44
//
55
// Created by John Holdsworth on 20/07/2016.
66
// Copyright (c) 2016 John Holdsworth. All rights reserved.
77
//
88

9-
import Foundation
109
import java_lang
1110
import java_util
1211
import java_awt
1312
import javax_swing
1413

15-
print( Runtime.getRuntime().javaObject )
16-
print( Runtime.getRuntime().maxMemory() )
14+
print( String(describing: Runtime.getRuntime().javaObject) )
15+
print( String(describing: Runtime.getRuntime().maxMemory()) )
1716
let e = java_lang.Exception("JKKH")
18-
print( e.javaObject )
19-
print( ClassNotFoundException(casting: e) )
20-
print( Throwable(casting: e) )
21-
print( Exception(casting: e) )
22-
print( JavaClass(casting: e) )
23-
print( System.getenv("HOME"))
17+
print( String(describing: e.javaObject) )
18+
print( String(describing: ClassNotFoundException(casting: e)) )
19+
print( String(describing: Throwable(casting: e)) )
20+
print( String(describing: Exception(casting: e)) )
21+
print( String(describing: JavaClass(casting: e)) )
22+
print( String(describing: System.getenv("HOME")) )
2423
print( System.getProperty("java.class.path") )
2524
print( System.getProperty("java.version") )
2625
print( System.getProperty("java.vendor") )
@@ -59,7 +58,7 @@ JNI.background {
5958
}
6059

6160
JNI.background {
62-
let myExample = SimpleJTreeExample( "Simple JTree Example" )
61+
_ = SimpleJTreeExample( "Simple JTree Example" )
6362
}
6463

6564
JNI.background {
@@ -76,7 +75,7 @@ Thread( {
7675
} ).start()
7776

7877
JNI.background {
79-
let philosophersFrame = PhilosophersJList()
78+
_ = PhilosophersJList()
8079
}
8180

8281
JNI.background {
@@ -101,7 +100,7 @@ JNI.background {
101100
f.setSize(200,300)
102101
let cp = f.getContentPane()!
103102
cp.setLayout(nil)
104-
// let names = ["Beate", "Claudia", "Fjodor", "Fred", "Friedrich", "Fritz", "Frodo", "Hermann", "Willi"]
103+
// let names = ["Beate", "Claudia", "Fjodor", "Fred", "Friedrich", "Fritz", "Frodo", "Hermann", "Willi"]
105104
// cBox = AutoComplete(items: names.map { JavaString( $0 ) })
106105
let locales = JavaLocale.getAvailableLocales()!//
107106
cBox = AutoComplete(items: locales)

0 commit comments

Comments
 (0)