小编Mar*_*ria的帖子

使用 Visual Studio 在 Opengl 1 中创建纹理动画的最佳方法是什么?

我想创建一个简单的动画来显示使用 OpenGL 飞行的蝴蝶/鸟,但我不知道如何解决这个问题。

由于动画很小,因此创建一个具有两个图像的纹理来表示动画会是一个很好的解决方案吗?如果是这样,我应该如何在他们之间交换图片?

c++ opengl animation

5
推荐指数
1
解决办法
5238
查看次数

如何指定 JSON 实例由特定的 JSON Schema 定义

我的问题是如何知道使用哪个 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)

java json jsonschema

5
推荐指数
1
解决办法
674
查看次数

按下JFrame中的按钮后打开JPanel

我知道这个问题已被问到,但我找不到解决办法.

我创建了一个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)

java swing

4
推荐指数
1
解决办法
2006
查看次数

标签 统计

java ×2

animation ×1

c++ ×1

json ×1

jsonschema ×1

opengl ×1

swing ×1