Can we add shadow effects in Java swing? [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What code shall I use to add shadow effects to a panel in Java swing, I know the same is available in javafx but can we do the same in swing?

Swing does not provide built-in capabilities for these.
You can drop shadow either by adding border or draw manually. Here are some examples for dropping shadow from JPanel
Animation is more complex, one approach is to use timer and change properties or draw on appropriate ticks, another is to incorporate some library like Timing Framework.
As a side note, you are asking two different questions in one and probably you need to do some research by yourself before posting and provide the results in the question.

Related

JavaFX displaying scalable vector graphics? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to include sth like a logo or a header/banner into my window. I possibly want to avoid using png/jpg Images, because this could look weird when my application runs on high res displays. So i created my banner as an svg. How can i insert this into my window? I know that it isn't possible to include it with the ImageView class of javafx, but i heard about the possibility to compose an svgpath-group in fxml/css and then load it via fxmlloader. But how do i do this whith all things like color gradients, ...? How do i have to compose my java/fxml document to show a scalable banner?
There are various options do do this. I gave you a hint to the first one already in your previous question. (Use e(fx)clipse and convert the SVG to an FXML file.) This also handles all the color and gradient issues.
Another option is to use this little library https://github.com/codecentric/javafxsvg which makes it possible to treat any SVG image in the same way as a regular JavaFX image. It is rendered internally and can thus be adapted to any size or resolution change.

How to create graphics in Java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I was wondering about how is possible to make graphics in a programming language just like Java, I mean in the web there are HTML + CSS etc but what here?
I already found out I might start to code with Java Swing (?) but if that's so: where's the best place to start learning it and really briefly: what can I do with that?
Please, note I don't want to start a broad talk with this question, so don't worry and be brief if you don't want to spen too many words with it ;)
For graphics you can use a Canvas/JPanel with Swing, JavaFX, or libGDX if you need a bit more power behind your graphics as it used OpenGL.
As some of the other commenters have already shown, there are many tutorials on how to use all three options, so you're pretty-well set to learn whichever you choose. I'm not entirely sure how well JavaFX deals with graphics, but Swing works perfectly fine for most purposes.

Action on connected device in Java Swing [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a Swing JFrame with some labels and buttons. I need to perform some actions when device is plugged. I do not know and didn't find whether I can use ActionListener or something like this.
What you will need is information on the device driver and how to be able to write code to catch events from the device. Note that they may have a library for this, but it might be in another language such as C or C++, and this could possibly force you to write code in this language or use JNI or JNA to interface their library with Java or both.
ActionListener is applied only to actions in buttos, menus, popup, etc.
I guess that you need create something using JNI to listen for specific events in SO.

How do you make GUI buttons that lead to different pages in the directory with Java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm making a program for my mother to repay here for all she did with me. I am trying to make a program similar to Cash Register Express. How would I make a GUI similar to it and linking to other pages? And if it doesn't work with Java, any other programming languages?
Start by taking a look at Creating a GUI With JFC/Swing and you will want to pay close attention to How to Use CardLayout
CardLayout used in Swings will be a good option. All the best for your work !

how to add multiple tab support feature in my notepad application using java? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I made a notepad application using java swing and currently it has the following features in it, you can create a new file and save it to the desired location also you can open an existing file, edit it and save it on a new location or update the existing one.Now i want to add the feature that would support the multiple file editing/creating at the same time, just like in notepad++. I have not much idea about how could this be done, please tell me the way to do it.would multi threading help?
Take a look at the jTabbedPane documentation:
http://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html
With the tabbed pane you can use several components and manage them all without threading (only one tab is active at a time) it will just require some additional logic to determine which tab/text area you are currently viewing when the toolbar features are used.

Categories

Resources