you can use the Gregorian Calendar class to create an instance of that class and then extract the data that you need from that object
http://docs.oracle.com/javase/6/docs...nCalendar.html
once that is done, you should probably create a JLabel and set the text as the date and time that you want. You will then add it to a JPanel inside your JFrame.
Something like this:
...
User Profile
Collapse
-
-
your best bet would be to use a java excel library
http://jexcelapi.sourceforge.net/
this should get you started...Leave a comment:
-
This website helped me when i was building my client/server application.
http://www.oracle.com/technetwork/ja...et-140484.html
it shows the client and the server and some great examples...Leave a comment:
-
if you want to have your table reflect changes once the user manipulates it, you can apply the observer pattern
http://en.wikipedia.org/wiki/Observer_pattern
or you can simply call update() or updateUI() on your JTable every time the user manipulates the table.
i would also recommend that you refactor some of your code into separate classes so it's a little more organized. For example, i would have one class...Leave a comment:
-
would you be able to provide some code that you have tried? i believe if you are using a layout manager, then the buttons should move around accordingly. If you are not using a layout manager and placing the components on the frame using x,y coordinates then you will have to update the location of each component separatelyLeave a comment:
-
I would do it as follows: convert the string into a character array and then using a for-loop, insert a "/" at every 4th position (if your counter starts at 0)
Code:public static String divideString(String sampleString, int breakPosition){ char[] charString = sampleString.toCharArray(); String newString = ""; for(int i = 0; i < charString.length; i++){ if(charString.length
Leave a comment:
-
what you can do is actually use the next nextLine(); method which takes the whole line the user entered into a string. If you decided to do this, you will have to parse out the irrational numbers you want, which could be cumbersome if you're not familiar with java regex... but it can still be done.
From my experience, the easiest way would be the way i described above. This way, when you prompt the user for the first irrational number,...Leave a comment:
-
one quick thing you can do is:
Code:catch(InputMismatchException e) { e.printStackTrace(); System.out.println(e.getMessage()); }
e.getMessage() will help you in determining why you got that message
i have not run the code, but i would have to say that your while-loop is probably not working as you expect....Leave a comment:
-
the problem with the code you gave as an example, is that the value of N will never be 0 or 1 and because of this, your value of N is continuously growing until your machine runs out of room on the stack... hence the StackOverFlow exception.
a closer look at the problem will actually show you how to solve it:
in order to use recursion, you need to call the same function but gradually decreasing your value until it gets to zero....Leave a comment:
-
i've never used the ButtonHandler class before so i'm not quite sure how it's supposed to work, but i have gotten events fired off after clicking a button. here's how i did it:
for each button:
Code:JButton searchButton = new JButton("Search"); searchButton.addActionListener(this);
Code:public void
Leave a comment:
-
I'm happy to see a non-developer trying to learn something about coding :). 2 things though, you should probably use the code tags (denoted by the # symbol) to help display the code properly, and you should probably post this topic within the javascript forums. Take a look at this web site, it may help you out
http://www.daniweb.com/web-developme...threads/272293
best of luck...Leave a comment:
-
if your stacktrace is being shown to the user, you probably have a try-catch block which looks like this:
Code:try{ something } catch(SomeException e){ e.printStackTrace(); }
Leave a comment:
-
what's a good regex for replacing ' followed by any character
Hi,
I've been trying to parse words like it's, can't, etc. so that all i'm left with is the root word i.e it for the word it's and can for the word can't.
This is what i have tried so far:
Code:String regex = "('.*$)|('[a-z]+)|('(\\w)+)";
thx -
rotaryfreak started a topic how do i merge two lists into one list and delete elements from first listin Javahow do i merge two lists into one list and delete elements from first list
Hi,
I have two map lists
Code://reads in a file which has a serialized object Map<String, List<Integer>> list1 = getListFromSerializedObjectFile(list[i+1]); Map<String, List<Integer>> list2 = getListFromSerializedObjectFile(list[i+2]);
-
How to parse html
Hi,
i previously worked on a program, written in c#, and a library was used to parse html. If i remember correctly, the library did two things: 1) it removed all html tags from the document and 2) converted the input stream to a string. I would like to do the same with java but the few libraries i found online dont seem to remove html tags, they just seem to clean up the html code so that the tags all match up with each other.... -
rotaryfreak started a topic p.waitfor does not wait for process to finish before starting another processin Javap.waitfor does not wait for process to finish before starting another process
Hi,
I'm creating a java program which will run other executable .jar files and the order of how these other jar files runs is important. I need to run 3 jar files. A.jar, B.jar, and C.jar. In my main program which will control the execution of my other jar files, this is what i have:
Code:public static void main(String[] args) { Program.processRequest(settings.ini) } //the settings.ini
-
How do i run jar files from within a java program?
Hi,
I have created several projects using eclipse and java. Each of these projects has a runnable .jar file. I would like to create one java program which would call each of my .jar files, kind of like a batch sequential system where one jar file would execute only after the previous one has completed.
Code:public static void main(String[] args) { call jar file 1 call jar file 2
-
How can I create a multi-dimensional hash table?
Hi,
I'm new to ruby and i've been experimenting on different ways on how to do this, but sadly nothing is working. I would like to create a multi-dimensional hash table in which i can access my members so that the output looks like this
[Key] [value1] [value2] [value3] [value4]
key 1 some val some val some val some val
key 2 some val some val some val some val ... -
Getting started with mobile development for smart phones
Hi Everyone,
I am a software engineering student and in my final year, we will be required to work on a year-long project of out choice. My team and i would like to develop a smart phone application (blackberry, iphone and android). I have browsed the internet and i havent really found the answer to my question, hopefully someone here will be able to help me. If i want to develop my app so that it can run cross-platform on blackberry,...
No activity results to display
Show More
Leave a comment: