我想创建一个简单的动画来显示使用 OpenGL 飞行的蝴蝶/鸟,但我不知道如何解决这个问题。
由于动画很小,因此创建一个具有两个图像的纹理来表示动画会是一个很好的解决方案吗?如果是这样,我应该如何在他们之间交换图片?
我的问题是如何知道使用哪个 JSON 模式来验证特定的 JSON 文档?我在 id 字段中指定了模式的 URL。这够了吗?我应该把 id 放在 JSON 中吗?我不确定我是否了解如何将 JSON 连接到特定的 JSON 架构。
这是我的架构
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "url/schema.json",
"title": "title",
"definitions": {
"emailObject": {
"type": "object",
"properties":{
"name": {
"description": "The name of the customer",
"type": "string",
"maxLength": 200
},
"email": {
"description": "The email of the customer",
"type": "string",
"format": "email",
"maxLength": 100
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我知道这个问题已被问到,但我找不到解决办法.
我创建了一个JFrame用于登录的按钮,我想在按下"Cont Nou"按钮打开一个带有新帐户的jpanel的新窗口,但不知道如何使初始帧消失并显示带有jpanel的帧.你有什么主意吗?谢谢!这就是我现在所做的:
这是JFrame登录:
public class LogIn extends JFrame implements ActionListener{
private JLabel labelEmail;
private JLabel labelParola;
private JTextField textFieldEmail;
private JPasswordField textFieldParola;
private JButton buttonLogin;
private JButton buttonContNou;
public LogIn (){
super();
this.setSize(400,200);
this.setTitle("Login");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(null);
this.setResizable(false);
this.setupComponents();
}
private void setupComponents(){
labelEmail = new JLabel("Email: ");
labelParola = new JLabel("Parola: ");
textFieldEmail = new JTextField();
textFieldParola = new JPasswordField();
buttonContNou = new JButton("Cont Nou");
buttonLogin = new JButton("Login");
labelEmail.setBounds(30,30,50,20);
labelParola.setBounds(30,70,50,20);
textFieldEmail.setBounds(100,30,185,20);
textFieldParola.setBounds(100,70,185,20);
buttonContNou.setBounds(185,110,100,20);
buttonLogin.setBounds(100,110,75,20); …Run Code Online (Sandbox Code Playgroud)