|
hi, I'm looking for a way to disable the minimize button in the JFrame's titlebar. I've been googling on how to solve this, I didn't get the answer that i've been looking for...
some suggestions include:
1. using a jdialog -> but the maximize button will also be hidden
2. using JInternalFrame -> but it's not the look-and-feel that i want to achieve
please help me with this one... at first, i thought it would be easy because i thought that there's a setMinimizeable or setIconifiable method for JFrame, but there isn't.
|
|
|
|
|
There is no way to do this - you will have to use JDialog.
Maximize and minimize are 2 functions that are literally combined.
Another approach would be to make the JFrame undecorated(true) and to draw some buttons yourself (and a title bar if you need a real title bar).
|
|
|
|
|
can i know how to the excel files can be imported into sql database by using java codes..
thank u
u.vinothh@gmail.com
|
|
|
|
|
What does "imported" mean?
Do you want to store the excel file itself into the database?
Or do you want to read the data from the excel file and then store that into columns in the database?
For the first option read the file in binary (bytes, not String/char) and then stream it via JDBC.
For the second, easiest is don't use java. Store the excel file as CSV then use the import features of the database to load it.
|
|
|
|
|
I have a project with Java Eclipse for android which stores data in SQLLite. My issue comes in when I include 100 lines of INSERT, it prompts me the EXCEEDED 65535 bytes.
Is it possible to place 2 "provider android:name=" in manifest then create 2 sets of the ContentProvider then make the second provider run like a continuation of the first set?
Hope you can help me. This is my first project with android. Thank you.
|
|
|
|
|
false approach.
Why do you insert 100 rows into the database at once? what is that? can't you narrow that down?
you should limit the data - paging could also be a solution.
|
|
|
|
|
What my objective is to update the database if there is a new version. Normally 1 category contains between 50 to 100 records which I hardcode in ContentProvider. Since I was getting the exceeded 65535 error, I had to split the insert to 2 classes however I am not sure how. Should I place 2 Provider android:name in Manifest? I am lost.
However, if there are any better options I am open to it since I am very new to Java Eclipse.
Thank you.
|
|
|
|
|
Given the following code:
private String name;
private List<String> years;
private List<String> studyChoices;
private void doCheck() {
if (!name.isEmpty() || name == null) {
}
for (String year : years) {
if (!year.isEmpty() || year == null) {
}
}
for (String studyChoice : studyChoices) {
if (!studyChoice.isEmpty() || studyChoice == null){
}
}
}
How do I condense this code into a more elegant and OO solution? Maybe put it all in one list and check for each item in that list?
I would like something like:
'If any of these parameters were not passed in or if they are empty, output an error message, else give the desired output'.
Basically I have to write a Servlet that gets form parameters from the request and checks if all parameters were provided. If they were, it is then supposed to write an output page.
Any ideas?
Thanks
|
|
|
|
|
First thing is that all your tests are the wrong way round (and logically wrong I suspect), you should check the variable is not null before using it as a reference to a method thus:
if (name == null || name.isEmpty()) {
if (name != null && !name.isEmpty()) {
I am not sure how you would condense the two loops any more as they appear to be independent of each other.
|
|
|
|
|
Is this entered from a GUI or is this object coming from some API?
For a GUI you can also use a GUI sided validation. You can e.g. use a KeyListener and validate the entered value right away.
For an API side validation I would suggest a Validation Layer which has to be passed before the data is used.
Your code - as Richard already stated - is a bit mixed up. Here is a valid suggestion:
private void doCheck() {
if (name != null && name != "") {
for (String year : years) {
if (year != null && year != "" ) {
try{
int i = Integer.parseInt(year);
}
catch(Exception oException){
}
}
}
for (String studyChoice : studyChoices) {
if (studyChoice!=null && studyChoice != ""){
}
}
}
else{ }
}
|
|
|
|
|
i am trying to design a simulation with java for my project title location-aware communication to achieve social inclusion and social responsibility which is a telecommunication project which conveys messages to subscribers that are mostly affected or benefited by the piece of information and shows boosters that are necessary to make this possible.
|
|
|
|
|
We believe you. What is the question?
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Structure - it's all about structure.
No matter if face to face, while working or anywhere else.
Especially when writing some.
|
|
|
|
|
Simulation with Java
If you've never failed... You've never lived...
|
|
|
|
|
Is there a question in all that babble somewhere?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello
Is there an article to open an excel file and write through jxl files.
Every time I try to write into excel file a new file is created instead of opening the old file.
Pritha
|
|
|
|
|
prithaa wrote: Is there an article to open an excel file Quite possibly, have you tried a Google search?
prithaa wrote: a new file is created instead of opening the old file. Without seeing your code I don't think we can guess what you may be doing wrong.
[edit]
This method[^] is probably what you are looking for.
[/edit]
|
|
|
|
|
thanks
but the above link is not opening
my problem was the following
InputStream inp = new FileInputStream("d:/Writefile.xls");
WorkbookSettings ws = new WorkbookSettings();
Workbook wb = Workbook.getWorkbook(inp, ws);
Sheet sheet = wb.getSheet(0);
Number number;
number = new Number(0, 0, 453.25, times);
((WritableSheet) sheet).addCell(number);
wb.close();
The above code doesnt add the cell to the given file just opens the file.I get DispatchUnCaughtException for the line
((WritableSheet) sheet).addCell(number);
Thanks for the reply
Pritha
|
|
|
|
|
|
thanks Richard
but a
WritableWorkbook creates a new workbook and has no method which opens a workbook
Pritha
|
|
|
|
|
This method[^] creates one. May I suggest you go through all the documentation to check which methods are required to create the objects you are trying to work with.
|
|
|
|
|
thanks for the article
but i cant still open a writableworkbook .i can write on a new
workbook
but cant write on an existing workbook
I didnt find any method doing that either in writableworkbook
regards
Pritha
|
|
|
|
|
|
prithaa wrote: thanks for the article
I did not provide one, I wonder what you have been looking at.
prithaa wrote: but i cant still open a writableworkbook
Did you follow my advice and read all the documentation in the link I gave you? It clearly shows how to create a writeable workbook from an existing file.
|
|
|
|
|
yes i did read the link u sent and looked at the
class writablework
but there is no method which opens an existing .xls file
Regards
Pritha
|
|
|
|