我正在努力更新表的内容。
实际上,代码的作用是:它用一些JTextField打开一个JDialog(没有内部类)。
提交新数据后,它可以直接用于保存tab2 JTable的类。当我再次为同一个表行打开JDialog时,该表将正确更新,但我希望它在EditData提交数据后立即更新。
我明白为什么现在没有,但现在我被卡住了。
我如何知道EditData是否已关闭,甚至更好,是否按下了提交按钮,或者 - 甚至更好 - 如果我在EditData中定义一些布尔成功(),它会告诉我输入是否正确;如何从主类访问它?
.drag-file-ct .x-innerhtml {
pointer-events: none;
}
.drag-file-fadeout {
opacity: 0;
-webkit-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
.drag-file-label {
font-size: 18px;
padding-top: 30px;
text-align: center;
pointer-events: none;
}
.drag-file-icon {
font-family: FontAwesome;
display: block;
font-size: 64px;
margin-top: 50px;
text-align: center;
pointer-events: none;
}
.active .drag-file-icon {
display: block;
}
.active .drag-file-icon:after {
content: "\f058";
color: #8BC34A;
}
.dropped .drag-file-icon {
display: block;
}
.dropped .drag-file-icon:after {
content: "\f013";
color: #9E9E9E;
}
.nosupport .drag-file-icon {
display: block;
}
.nosupport .drag-file-icon:after {
content: "\f119";
color: #9E9E9E;
}
答案 0 :(得分:0)
如何判断EditData是否已关闭,
public class Brain : MonoBehaviour
{
public GameObject Output, Input, AdjustDbInput;
string ProcessInput;
public void Process (Text TextInput)
{
ProcessInput = TextInput.text;
if (System.IO.File.Exists(Application.dataPath + "/" + ProcessInput + ".txt"))
Output.GetComponent<Text>().text =
System.IO.File.ReadAllText($"{Application.dataPath}/{ProcessInput}.txt");
else
{
Input.gameObject.SetActive(false);
AdjustDbInput.gameObject.SetActive(true);
}
}
public void Adjust (Text Response)
{
StreamWriter writer = new StreamWriter(${Application.dataPath}/{ProcessInput}.txt");
writer.WriteLine(Response.text);
writer.Close();
Input.gameObject.SetActive (true);
AdjustDbInput.gameObject.SetActive (false);
}
}
。而是让调用代码在需要的地方和时间创建实例,然后在需要的地方和时间将其设置为可见。甚至更好,是否按下了提交按钮,或者 - 甚至更好 - 如果我在EditData中定义一些布尔成功(),它会告诉我输入是否正确;
setVisible(true)
,此对话框将返回一个int,告诉您按下了哪个按钮。如何从主类访问它?
使EditData成为类中的一个字段,这样您就可以在正确处理后查询其状态。