I don't know very much about Java (I know the basics). I want to create an Image Gallery with Netbeans, but I have absolutely no clue how to do this.
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 ;).
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.
Thanks ;)
With netbeans it's really easy, netbeans has a JFrame/JPanel drag&drop designer/gui builder (right click on 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.
http://netbeans.org/kb/docs/java/quickstart-gui.html some details on how to use the netbeans gui builder.
With this builder you can also add events to the different components. If you want to view a directory use JFileChooser.
Related
I have been trying for the past few hours to figure out how to add a label component to a window however with no prevail. I have created a new desktop application project in Netbeans and it comes with pre-generated code. I want to add a label to it but it just does not show?. I am unsure as to why because i am following the normal panel.add(component) convention.
Would really appreciate some help!. I pasted the full file sourecode here http://pastebin.com/qJk6bSWn .
Any ideas?
What layout is your JPanel using? If it's using the Netbeans GUI builder default of free design you won't be able to manually add components. You'll need to set it to some layout manager.
Parts of your gui can have the Free Design layout, but you'll need to change the layout of the components that you want to manually add to.
I'm looking for a really simple widget: tree view on the left pane, folder contents on the right, switchable between icons, thumbnails, or detail view. Basically a functional (not pixel for pixel) emulation of Windows File Explorer, but within the Java app. How to do this using only built-in Java libraries? Or a very lightweight framework?
NOT A DUPLICATE
My question is different from the above and I now realize it's a little harder to explain than I initially expected. Two clarifications:
My question is not about a File Chooser. I'm asking about a File Explorer type of dialog. The difference is that a File Chooser is really focused on one task, choosing a file. A File Explorer is a little less focused, and lets the user browse around without a clear objective.
My question is not about native operating system UI / L&F emulation. At all. I'm asking about the basic capability to display the contents of the filesystem using icons and thumbnails. The style and borders etc are not part of my question.
EDIT
I'm looking for something like this
Notice how it's different from this (JFileChooser)
JFileChooser will do that if you are wanting something built in to Java.
https://docs.oracle.com/javase/7/docs/api/javax/swing/JFileChooser.html
If you are not using Swing but SWT (like Eclipse) you can use SWT FileDialog
You could use the AWT library to customly render the entirety of Explorer. Whilst the only hard part about this is correctly using layout managers to get components exactly where you want them and adding event listeners for each button, using AWT wouldn't make it look like Explorer on different operating systems because AWT uses the native system components.
You could check if the OS is not Windows and then use Swing if it isn't. In that case, you'd have to retexture every single used component such that its look and feel is the same as your targeted Windows version. Even if you did that, you'd still have to somehow change the JFrame's look and feel, which is possible using dark magic, but quite obscur. You can do this in a very quirky way, just setUndecorated(true) and manipulate the JFrame's boundaries until it lets you draw outside the JFrame, so that you can draw the Windows' decoration around it without resizing the Window. On top of that, you'd also have to check if it's maximised, as maximized windows don't quite look the same in Windows.
To cut things short, just use JFileChooser if you just want to allow the user to select one or multiple files. There isn't really any point in recreating Explorer, but if that's what you want to do, I'm not stopping you.
I am developing for android and I am using the Android Studio.I have many XML files and I never used the dimens.xml. Now I want to use it, but I don't want to go through the pains of creating a dimension for each view. I was wondering if there is a programming out there that can automatically do this, or if there is a function in Android Studio to create the dimension for every view that I have. Something simple, as in fewest clicks as possible. Otherwise, I might consider writing a script.
Sorry I know it was too late for the answer...There is no auto create dimension.But there is already dimension are created by a person.
Click this link to Download the dimension
here you can see different types of dimension for different screen size...
you can download individually or all together. Download and paste it in the res folder.
P.S: Please copy the dimens.xml from vlaues(in the site) and paste in your project res > values...
Update:there is also another way. Paste this code in gradle and sync
compile 'com.intuit.sdp:sdp-android:1.0.3
Hope It helps...
I have been trying for the past few hours to figure out how to add a label component to a window however with no prevail. I have created a new desktop application project in Netbeans and it comes with pre-generated code. I want to add a label to it but it just does not show?. I am unsure as to why because i am following the normal panel.add(component) convention.
Would really appreciate some help!. I pasted the full file sourecode here http://pastebin.com/qJk6bSWn .
Any ideas?
What layout is your JPanel using? If it's using the Netbeans GUI builder default of free design you won't be able to manually add components. You'll need to set it to some layout manager.
Parts of your gui can have the Free Design layout, but you'll need to change the layout of the components that you want to manually add to.
I need to create something like internal frame in netbeans platform, which loads file from any location.
I tried it by jInternalFrame, but I was not able to find some container to which I can add my frame. I am working in netbeans platform, which has own pre-created main window.
Pease help me by any advice, I am dealing with this about 10 hours, still without result.
Use WindowManager.getDefault().getMainWindow() as parent for JFileChooser dialog.