1- package dev .webview .webview_java . example . swing ;
1+ package dev .webview .webview_java ;
22
33import java .awt .Canvas ;
4+ import java .awt .Color ;
45import java .awt .Dimension ;
56import java .awt .Graphics ;
67import java .io .Closeable ;
78import java .util .function .Consumer ;
89
9- import co .casterlabs .commons .platform .OSDistribution ;
10- import co .casterlabs .commons .platform .Platform ;
11- import dev .webview .webview_java .Webview ;
1210import lombok .Getter ;
1311import lombok .Setter ;
1412
@@ -41,6 +39,7 @@ public AWTWebview() {
4139 */
4240 public AWTWebview (boolean debug ) {
4341 this .debug = debug ;
42+ this .setBackground (Color .BLACK );
4443 }
4544
4645 @ Override
@@ -59,7 +58,6 @@ public void paint(Graphics g) {
5958 this .initialized = true ;
6059
6160 // We need to create the webview off of the swing thread.
62-
6361 Thread t = new Thread (() -> {
6462 this .webview = new Webview (this .debug , this );
6563
@@ -81,17 +79,7 @@ private void updateSize() {
8179 int width = this .lastSize .width ;
8280 int height = this .lastSize .height ;
8381
84- // There is a random margin on Windows that isn't visible, so we must
85- // compensate.
86- // TODO figure out why this is caused.
87- if (Platform .osDistribution == OSDistribution .WINDOWS_NT ) {
88- width -= 16 ;
89- height -= 39 ;
90- }
91-
9282 this .webview .setFixedSize (width , height );
93- //this.webview.setMinSize(width, height);
94- //this.webview.setMaxSize(width, height);
9583 }
9684
9785 @ Override
0 commit comments