eclipse - porting java program from windows to linux: invisible java swing elements in main frame on linux only -
so trying port large java program windows linux (centos 7). program works fine on windows, in linux set main frame of application shows (title, maximize minimize exit buttons found on top bar of applications). java swing elements (buttons, tables, drop down menus) invisible @ frame (clicking on them bring invisible menu). again works fine on windows, isn't code.
things i've tried:
-attempt: trying run different program wrote has a java swing
gui
result: same problem.
conclusions: not code problem
-attempt: downloading simple gui example works on windows
result: same problem
conclusions: not code problem
-attempt: downloading simpler gui example works on windows
result: same problem
conclusions: not code problem
-attempt: reinstall java (yum remove, yum install)
result: same problem
conclusions: don't know draw this, not installation of java?
-attempt: reconfigure build , classpaths
result: same problem
conlusions: don't know draw this, not build , classpaths?
-attempt: new centos 7 vm , reinstall on there
result: same problem
conlusions: centos have problem swing?
useful? random facts:
java -version returns openjdk runtime environment (build 1.8.0_141-b16) openjdk 64-bit server vm (build 25.141-b16, mixed mode)
which java returns /usr/bin/java
whereis java returns java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
i'm using eclipse oxygen standard edition java run , compile
under run configurations jre set java-1.8.0-openjdk-1.8.0.141-1.b16.el7_3.x86_64
runtime classpath, source, environment default.
buildpath includes libraries otherwise default.
my firefox gui broken (the tabbar transparent) wonder if has it
the buttons work on gui, invisible.
i uninstalled , reinstalled java , mariadb
i tried building apache ant.
i did export java_home @ 1 point don't think it's set anymore because nothing if echo $java_home. ant seems think /usr/lib/jvm/java? don't know.
suspicions: -incorrect java installation/versioning
-corrupted gnome gui
-i messed somthing when did yum update/all yum installing , reinstalling did.
-swings setlookandfeel function, although unlikely because doesnt work simple programs dont use that
fairly new everything. software engineering, community, etc.
edit
here piece of code produces same invisible button problem on linux computer works on windows:
package com.zetcode; import java.awt.container; import java.awt.eventqueue; import java.awt.event.actionevent; import javax.swing.grouplayout; import javax.swing.jbutton; import javax.swing.jcomponent; import javax.swing.jframe; public class quitbuttonex extends jframe { public quitbuttonex() { initui(); } private void initui() { jbutton quitbutton = new jbutton("quit"); quitbutton.addactionlistener((actionevent event) -> { system.exit(0); }); createlayout(quitbutton); settitle("quit button"); setsize(300, 200); setlocationrelativeto(null); setdefaultcloseoperation(exit_on_close); } private void createlayout(jcomponent... arg) { container pane = getcontentpane(); grouplayout gl = new grouplayout(pane); pane.setlayout(gl); gl.setautocreatecontainergaps(true); gl.sethorizontalgroup(gl.createsequentialgroup() .addcomponent(arg[0]) ); gl.setverticalgroup(gl.createsequentialgroup() .addcomponent(arg[0]) ); } public static void main(string[] args) { eventqueue.invokelater(() -> { quitbuttonex ex = new quitbuttonex(); ex.setvisible(true); }); }
edit
pictures:
functional buttons, invisible , on semi transparent jframe
edit: tail -f /var/log/messages gives following 2 errors: "gnome-session: window manager warning: invalid wm_transient_for window 0x2e00004 specified 0x2e0001a (progress..)" , "window manager warning: buggy client sent _net_active_window message timestamp of 0 0x2200048 ()"
Comments
Post a Comment