Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 文本字段到语音气泡的CSS编辑_Java_Css_Javafx_Scenebuilder - Fatal编程技术网

Java 文本字段到语音气泡的CSS编辑

Java 文本字段到语音气泡的CSS编辑,java,css,javafx,scenebuilder,Java,Css,Javafx,Scenebuilder,我正在创建我的第一个聊天程序(使用java中的图形),我正在使用JavaFx Scene builder创建一个GUI,其中包含一些图片,然后是1-2个人,他们可以彼此聊天。 其思想是,当连接到服务器的任何一个客户端与另一个客户端通信时,都会出现一个小的语音气泡 我的想法是使用一个文本字段创建它,然后在CSS中编辑它,使它看起来像一个语音气泡 我曾经试图寻找css样式表来配置我的文本字段,但到目前为止没有任何效果,有人能帮我吗?到目前为止,我尝试的两种样式表是: .speech-bubb

我正在创建我的第一个聊天程序(使用java中的图形),我正在使用JavaFx Scene builder创建一个GUI,其中包含一些图片,然后是1-2个人,他们可以彼此聊天。 其思想是,当连接到服务器的任何一个客户端与另一个客户端通信时,都会出现一个小的语音气泡

我的想法是使用一个文本字段创建它,然后在CSS中编辑它,使它看起来像一个语音气泡

我曾经试图寻找css样式表来配置我的文本字段,但到目前为止没有任何效果,有人能帮我吗?到目前为止,我尝试的两种样式表是:

    .speech-bubble {
    position:relative;
    width: 320px;
    padding: 10px;
    margin: 3em;
    background-color:#FFF;
    color: #666;
    font: normal 12px "Segoe UI", Arial, Sans-serif;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 10px solid rgba(0,0,0,0.095);
}
.speech-bubble p {
    font-size: 1.25em;
}

.speech-bubble:before,
.speech-bubble:after {
    content: "\0020";
    display:block;
    position:absolute;
    top:-20px;  /* Offset top the height of the pointer's border-width */
    left:20px;
    z-index:2;
    width: 0;
    height: 0;
    overflow:hidden;
    border: solid 20px transparent;
    border-top: 0;
    border-bottom-color:#FFF;
}
.speech-bubble:before {
    top:-30px; /* Offset of pointer border-width + bubble border-width */
    z-index:1;
    border-bottom-color:rgba(0,0,0,0.095);
}


    .bubble{
    background-color: #F2F2F2;
    border-radius: 5px;
    box-shadow: 0px 0px 6px #B2B2B2;
    height: 200px;
    margin: 20px;
    width:  275px;
}

.bubble::after {
    background-color: #F2F2F2;
    box-shadow: -2px 2px 2px 0 rgba( 178, 178, 178, .4 );
    content: "\00a0";
    display: block;
    height: 20px;
    left: -10px;
    position: relative;
    top: 20px;
    transform: rotate( 45deg );
    width:  20px;
}
问题是,当我把它添加到我的文本字段时,它不会改变外观。我不知道我是否做错了,或者这些样式表是否不适合文本字段


希望有人能帮助我,提前谢谢你:

这个CSS看起来像web CSS,据我所知,它不受支持。有效的JavaFXCSS属性通常以“-fx”开头。这里有一个参考:


确保文本字段控件上有speech bubble CSS类。尝试逐个添加更改并在SceneBuilder中检查结果。当我尝试一次做太多更改时,其中一个不可避免地无法工作。

感谢您的回复您认为我应该能够或多或少地将其转换为JavaFx吗?我认为您应该能够使文本字段看起来像您希望的那样,而不需要太多麻烦。支持边框半径、阴影、边距和填充。不显示宽度、高度和布局等属性。需要在“场景生成器布局”选项卡中指定此信息。