I'm using System Tray and Menu Item to create a simple JFrame/tray application, and I was trying to colorize some of the menu item texts, I searched and looked at the API's, but just couldn't find anything that allows me to do that.
Is it even possible? If not, are there any available options for me to achieve this?
Related
I am trying to create a program in Javafx + Scenebuilder that has a tab pane for creating/loading a card set and another tab for quizzing yourself using that card set, I want to know how to take input from the user in a series of TextFields for a Title to the flash card set and tie that to the flashcard's Question & Answer(entered in TextFields). The user can then enter the flashcard's Title and hit a load button and then go to the other tab and be quizzed with that flashcard set. I also need to know how to store the set so that it doesn't have to be entered every time the program opens.
I had researched on my own for some way to do this but couldn't find a good way to do this, that is why I asked for help.
A HashMap is what I need, after asking someone that actually would give a straightforward answer this is what I was told.
I am trying to make a "Oregon Trail" like game with JAVA for my Computer Science class. It's all going well so far, but I would like some suggestions on ways of doing the following:
The words at the bottom "Health", "Stats", etc are buttons. I was wondering what the best way of making those buttons present information would be. Is there a way I could show them in that information in one of the bottom squares, and when a different button is clicked change the info to that one? Or would it be best to have popup frames to display the information?
IMHO, I'd go with display the content or info of the button in the panels above.
It keeps the information together in a single place and generally makes it easier to manage, no disappearing windows behind other windows for example.
You have any number of options depending on the information you want to display. You could simply use a none editable JTextArea if the information is just text, or a JList if you want to list items if the data is more structured, a JTable and even a JTree if you want to group the data into some kind of groupable hierarchy.
You could use combinations of each, based on your needs
I'm working on an app in JFace. So I have a CTabFolder with a number of CTabItems in it. What I would like is to be able to automatically switch to display an arbitrary CTabItem.
What I'm thinking is something like:
CTabFolder myFolder = FolderFactory.newFolder();
myFolder.showItem(myFolder.getItem((ARBITRARY_INT)));
/*These don't help!*/
//myFolder.update();
//myFolder.pack();
//myFolder.redraw();
The folder works just fine by itself. i.e. users may tab through with the mouse. The difference is that I would like to be able to show different tabs by default in different perspectives.
Any thoughts?
You need to use CTabFolder#setSelection(..). The show item only shows the item, like if there are a lot of items and some are hidden, this method will scroll to them.
I want to be able to drag & drop elements in running time with netbeans(Java).
Fo example: I'll have elements as Texboxt,Button,Labels,ComboBox,Panel, Listbox...etc
and I want to drag as many elements as I want, and this elements could be like my toolbox en my application.
My profesor was telling me that I could use Jgraph to do this functionality another thing that he mentioned me was that I could search for a Drag and drop library or framework. for example like in this website, 1: http://cacoo.com
image http://img43.imageshack.us/img43/431/idek.png
Edit: I added this image of an idea. Imagine this is your own editor, and it has its own elements, like shown in the toolbox. What I want is to drag those elements and drop them to the design area, like an IDE; that is my basic challenge rigth now. Also, I wonder if I could do this functionality with JGraph library or another framework that someone knows about it.
Obviously when I click the run button another window will pop up with the elements.
Is there any way to add StructuredTextEditor in SWT dialog? if not, is there any method that could be used to view and edit xml files from within a dialog (WizardPage)
Thanks!
The next step above StyledText would be to use JFace Text and SourceViewer. The viewer hooks up your text presentation to the StyleText widget, and is the viewer that the java editor uses. The viewer and the widget can then be used in a wizard or dialog.
For more information see http://wiki.eclipse.org/Platform_Text
Editors are displayed only in the editor area, so no, you can't get a StructuredTextEditor in a wizard page. What you need to do is use an SWT widget that will let you display and edit text. Since you want to be able to edit XML files, my guess is that StyledText would be of use to you. But you'll need to take care of a lot of things which are usually already taken care of (i.e. your editor's 'dirty' state etc.). I haven't tried doing what you want to do, so I can't offer a much better advice then this, but if I had to do it, taking a look at StyledText is where I would start.