Wrapper: update native window

This commit is contained in:
PeratX 2020-03-29 18:38:28 +08:00
parent eb1a15de76
commit f6c508883f
2 changed files with 40 additions and 47 deletions

View File

@ -161,7 +161,6 @@ class MiraiDownloaderProgressBarInUI(): MiraiDownloadProgressBar{
}
override fun complete() {
TODO("Not yet implemented")
}
}

View File

@ -7,17 +7,16 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:Suppress("EXPERIMENTAL_API_USAGE")
package net.mamoe.mirai.console.wrapper
import kotlinx.coroutines.*
import java.awt.Frame
import java.awt.Panel
import java.awt.TextArea
import java.awt.Toolkit
import java.io.File
import java.lang.StringBuilder
import java.net.URLClassLoader
import java.util.*
import javax.swing.JFrame
import javax.swing.JPanel
val contentPath by lazy {
@ -41,23 +40,17 @@ object WrapperMain {
fun main(args: Array<String>) {
gc()
if (args.contains("native") || args.contains("-native")) {
val f = Frame("Mirai-Console Version Check")
val f = JFrame("Mirai-Console Version Check")
f.setSize(500, 200)
f.setLocationRelativeTo(null)
f.isResizable = false
val srcSize= Toolkit.getDefaultToolkit().screenSize
val width = 300
val height = 200
val p = Panel()
val textArea = TextArea()
textArea.isEditable = false
p.add(textArea)
p.isVisible = true
f.setLocation((srcSize.width-width)/2, (srcSize.height-height)/2)
f.setSize(width, height)
val p = JPanel()
f.add(p)
val textArea = TextArea()
p.add(textArea)
textArea.isEditable = false
f.isVisible = true
uiLog("正在进行版本检查\n")
@ -160,15 +153,16 @@ object WrapperMain {
}
private class MiraiClassLoader(
protocol: File,
console: File,
parent: ClassLoader?
): URLClassLoader(arrayOf(
) : URLClassLoader(
arrayOf(
protocol.toURI().toURL(),
console.toURI().toURL()
), parent)
), parent
)
private object WrapperProperties {