关于设计摇摆gui [英] about designing swing gui

查看:69
本文介绍了关于设计摇摆gui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...



i我是java新手...

现在我需要设计1帧,有2个垂直帧,

在第一帧中我应该放置1个标签,然后是下拉列表..再次带有文本框的标签

,用户可以输入文字。

在第二帧我应该从文件夹导入文件并选择...也应该有一个开始按钮。

当我点击按钮时,所选文件应该被复制到另一个文件夹中,该文件夹可以位于相同或不同的驱动程序中。

plz指导我....

hi...

i am new to java...
now i need to design 1 frame with 2 vertical frames,
in the first frame i should put 1 label followed by drop down list..next again a label with text box
where user can enter text.
in the 2nd frame i should import files from a folder and select...there should be one start button also.
the moment i click on the button selected files should be copied into another folder which can be located in the same or different drivers.
plz guide me....

推荐答案

我不能就如何使用你的文件给你一个完整的建议,但对于2个垂直框架,我宁愿使用一个框架。我会在其中创建一个面板。在这个面板上,我会给出一个GridLayout(1,2)(1行,2列),然后再添加两个面板(如果你愿意,还可以添加内部面板)。



这样的事情:



Well i can''t give you a full advice on how to work with your files, but as for the 2 vertical frame, i would rather use one frame. I would create a panel in it. To this panel i would give a GridLayout(1,2) (1 row, 2 columns ) and then add two more panels ( internal panels if your prefer ).

Something like this:

public yourClass extends JFrame{


    JFrame myFrame=new JFrame();
    JPanel panelInFrame=new JPanel(new GridLayout(1,2));
    JPanel internalLeftPanel=new JPanel();
    Jpanel internalRightPanel=new JPanel();

    public void initializeWindow(){

            /**
             * initialize your window( setSize, setVisible etc.)
             * then...
            */

    window.add(panelInFrame);

    addInternalPanels();

        }

    void addInternalPanels(){

       panelInFrame.add(internalLeftPane);
       panelInFrame.add(internalRightPane);

       //here you could manipulate your labels, buttons etc.

    }


    public static void main(String[] args){

       yourClass program=new yourClass();
       program.initializeWindow();

    }


 }







我希望你理解。




I hope you understand.


这篇关于关于设计摇摆gui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆