JavaGUI,交互和切换场景

如何解决JavaGUI,交互和切换场景

我目前正在开发一个用Java制作GUI的项目。我在用Java制作gui方面很陌生,因此gui看起来很丑。我想知道是否有一种特殊的方式来改变场景,或者我是否只需要在另一个班级中结识新朋友并提供按钮操作来打开另一个GUI。我认为有一种更简单的方法,但我还没有做很多研究。

我想知道如何做到这一点,以便在按下添加按钮时实现。一个小的垂直区域将在scroolpane中弹出,我可以在其中创建多个区域,并且它们可以相互堆叠。事物上还会有不同的按钮。和文本一样,某些文本在我开始时需要进行自我更新。这样用户就有机会查看发生了什么。

因此,我需要有关如何制作和更新文本的帮助,以使其显示不同的刺痛。 Like this just with buttons on the end.

我还可以同时选择一个或多个这些“任务”。

我了解我是否要求很多,但我真的希望这件事能奏效。

如果您想知道我正在尝试制作一个自动从其他网站购买商品的机器人或程序。这可能是鞋子或衣服。这也称为运动鞋机器人,但我正计划使其购买其他东西。我要制作的东西称为任务,它将请求发送到网站并进行购买,并且将这些请求进行多次处理就可以更轻松地购买所需的商品。

如果有人提出了一些技巧或窍门,我也将不胜感激。

最后一件事是,如果有人对代理有任何经验,并向网站提出不同的请求,则会抛出代理。

谢谢您的时间。

只需在评论中询问您是否想知道什么。

这是我当前的代码

   import java.awt.BorderLayout;
   import java.awt.EventQueue;
   import java.awt.Font;
   import java.awt.event.ActionEvent;
   import java.awt.event.ActionListener;

   import javax.swing.JButton;
   import javax.swing.JFrame;
   import javax.swing.JPanel;
   import javax.swing.JToolBar;
   import javax.swing.border.EmptyBorder;

   public class profileGUIPane extends JFrame {

       private JFrame guiPane;

    /**
    * Launch the application.
    */

   /**
    * Create the frame.
    */
   
       public profileGUIPane() {
           initialize();
       }
   
   
       public void initialize() {
           guiPane = new JFrame();
           guiPane.setTitle("title");
           guiPane.setFont(new Font("Times New Roman",Font.PLAIN,12));
           guiPane.setBounds(100,100,613,331);
           guiPane.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
       
           JToolBar toolBar = new JToolBar();
           f guiPane.getContentPane().add(toolBar,BorderLayout.norTH);
       
           JButton mainpane = new JButton("maingui");
           tasksPane.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
               }
           });
           toolBar.add(mainpane);
       
           JButton secpane = new JButton("secondgui");
           profilePane.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
               }
           });
           toolBar.add(secpane);
       
           JButton settingsPane = new JButton("Settings");
           settingsPane.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
               }
           });
           toolBar.add(settingsPane);
       
           JButton opane = new JButton(" ");
           proxiesPane.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
               }
           });
           toolBar.add(opane);
           JPanel startstop = new JPanel();
       startstop.setBackground(new Color(255,153,153));
       frmCubeAio.getContentPane().add(startstop,BorderLayout.soUTH);
       
       JButton startAll = new JButton("Start");
       startstop.add(startAll);
       startAllTasks.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
           }
       });
       
       JButton stopAll = new JButton("Stop");
       startstop.add(stopAll);
       stopAllTasks.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
           }
       });
       
       JPanel edit = new JPanel();
       edittask.setBackground(new Color(222,184,135));
       frmCubeAio.getContentPane().add(edit,BorderLayout.WEST);
       
       Box Box = Box.createVerticalBox();

       
       JButton add = new JButton("Add");
       Box.add(add);
       addTask.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
               
           }
       });
       
       Component verticalStrut = Box.createVerticalStrut(20);
       Box.add(verticalStrut);
       
       JButton edit = new JButton("Edit");
       edit.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
           }
       });
       Box.add(edit);
       
       Component verticalStrut_1 = Box.createVerticalStrut(20);
       Box.add(verticalStrut_1);
       
       JButton remove = new JButton("Remove");
       Box.add(remove);
       removeTask.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
           }
       });
       
       Component verticalStrut_2 = Box.createVerticalStrut(20);
       Box.add(verticalStrut_2);
       
       JButton clone = new JButton("Clone");
       Box.add(clone);
       cloneTask.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
           }
       });
       
       edittask.add(Box);
       
       JScrollPane help = new JScrollPane();
       frmCubeAio.getContentPane().add(help,BorderLayout.CENTER);
       }
       
   }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?