简体   繁体   English

用Java创建画廊-Netbeans

[英]Creating a Gallery in Java - Netbeans

I don't know very much about Java (I know the basics). 我对Java不太了解(我了解基本知识)。 I want to create an Image Gallery with Netbeans, but I have absolutely no clue how to do this. 我想用Netbeans创建一个图片库,但是我完全不知道如何做。

What I want to do: 我想做的事:

The User should see all Images inside a specified folder (as thumbs) and should be able to view it in "original size" upon clicking on the Photo. 用户应该看到指定文件夹内的所有图像(以拇指为单位),并且在单击照片后应该能够以“原始大小”查看它。 Also (via a Button) he should be able to "transfer" an Image file to that folder. 另外(通过按钮),他应该能够将图像文件“传输”到该文件夹​​。

So basically I have a database of misc. 所以基本上我有一个杂项数据库。 articles, each article has some Images in a unique folder on the Filesystem (eg. /images/art_01), I want to display all images within this folder and have the possibility to add (speaking, copying) new Images into this folder (there is no need to delete an Image) arranged, so it doesn't look too disgusting ;). 文章,每篇文章在文件系统上的唯一文件夹中都有一些图像(例如/ images / art_01),我想显示此文件夹中的所有图像,并有可能在该文件夹中添加(说,复制)新图像(有不需要删除已排列的Image),因此它看起来不太令人讨厌;)。

Since I just now the basics of Java, I qould appreciate if someone could help me, with something I can adapt directly into a JFrame - if that's possible. 由于我只是Java的基础知识,如果有人可以帮助我,并且我可以直接将其适配到JFrame中,我将不胜感激-如果可能的话。

Thanks ;) 谢谢 ;)

With netbeans it's really easy, netbeans has a JFrame/JPanel drag&drop designer/gui builder (right click on package -> new -> JFrame form). 使用netbeans真的很容易,netbeans具有JFrame / JPanel拖放设计器/ gui生成器(右键单击package-> new-> JFrame form)。 After customizing the GUI you can make your main class extend your custom frame, or add a new custom panel to your JFrame, depending on whether you choose to make a JFrame or a JPanel. 自定义GUI之后,您可以使主类扩展自定义框架,也可以向JFrame添加新的自定义面板,具体取决于您选择制作JFrame还是JPanel。

http://netbeans.org/kb/docs/java/quickstart-gui.html some details on how to use the netbeans gui builder. http://netbeans.org/kb/docs/java/quickstart-gui.html有关如何使用netbeans gui构建器的一些详细信息。

With this builder you can also add events to the different components. 使用此构建器,您还可以将事件添加到不同的组件。 If you want to view a directory use JFileChooser. 如果要查看目录,请使用JFileChooser。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM