Tom Sakra

Greenhorn
+ Follow
since Oct 09, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Sakra

James Sabre wrote:If you are launching your Applet from a Servlet engine such as Tomcat or Jetty then my approach would be to have one or more Servlets that perform ALL database access and have your Applet invoke the Servlets using a very restrictive set of actions when they need to read or write data.

There are some security advantages to using this approach. Each client can be made to log on (user name and password may be enough) and then there is no way for anybody to access the database directly; the database password is never exposed outside the Servlet and, if using HTTP or HTTPS (the preferred approach), there will be no firewall problems.



Thanks for the solution, this seems like the way to go!
10 years ago
I have a microsoft database, however I can't connect to it directly through the internet - only locally, but I need to access it from an applet. So I was just wondering what kind of approach you guys would suggest to accomplish this? The microsoft database have to stay the way it is because it's administrated by a C# program, so the approach have to involve some way of contacting the database and passing on the result (true/false).

The interaction with the microsoft database is really simple, it's just a basic authentication (checking username/password) before the user is allowed to use the rest of the applet (connecting to a mysql database).

My first thought was using an application server (glassfish), but that approach seems way too involved and complicated to solve such a simple task.

Thanks in advance!
10 years ago
I've narrowed my problem down to a panel that's dynamically filled with some check boxes, which is located inside a pane of my tabbed pane-component. I suspect the problem is related to the items below the panel that contains the check boxes. Because the tabbed pane expands in height equal to the size of the panel with the check boxes. Is there any way of letting the subsequent components utilize the available space instead of acquiring more space (there's plenty of room, so there's no need for it to expand)?. I also want the user to be able to maximize the window, so I can't just use a fixed size either.

Since I'm using the NetBeans GUI builder, posting the code isn't really an option. I know this gets very abstract without screenshots or code, but I hope I've made my problem clear enough for you to understand my problem.

Update: I actually solved this as I was writing the post, but I decided to post it anyway, so that maybe anyone else encountering the same problem as me could find a solution here. Anyway, here's what I did: I put my subsequent components in a panel, then setting the bottom space around the component to default and also ticking off the "resizable" check box belonging to it. I also made sure that the panel containing the check boxes doesn't have vertical auto resizing, but instead attached a BoxLayout to it.
11 years ago
Of course not, but I find creating a relatively large GUI in NetBeans is a bit of a wrestle itself.
Since I'm using NetBeans to create the GUI, I'm pretty sure that creating that exact part
would've been easier manually. But I'm not familiar with using custom components in the NetBeans
GUI editor, so this will have to do for now. I might come back to it later if the schedule allows for it.
11 years ago
Yeah, but it doesn't maximize it completely either. It just uses about 200 pixels more than it should when I maximize the window.
So there's still room for it to stretch more, which doesn't make any sense as to why it just randomly stops, but I'd rather it stopped
stretching after the panel was filled. So is there any way to decide the size of the panel without using the vertical resizable option?

Edit:
Thanks for the help guys, but I just did what I asked for in the last line above :P Just added the preferredSize (height) of the given
checkboxes to a variable and adjusted the panel size to that variable, and using the BoxLayout with the page axis.
11 years ago
Hey

My program fills a panel with checkboxes dynamically and I want the panel to stretch accordingly to the amount of content,
this works fine as long as I keep the window at the same size at runtime as I do when I'm working in NetBeans. However, if I
try to maximize the window, the panel suddenly gets greedy and takes up a lot of extra space beneath the checkboxes, without
actually putting anything else in there.

Any suggestions as to how I could solve this? I've been using a BoxLayout with the vertical resizable on the aforementioned panel.
11 years ago
Hey

Does anyone know how to fill a table component using java? I tried implementing the JRDataSource and fill it with data,
but the table doesn't seem to use this data. Is there something I have to specify in iReport to make the table use the data
provided by the JRDataSource?
Hey

So I'm pretty new to JasperReports and iReport, but I've made a report (in iReport) that fetches data from my MySQL
database. However, the problem I'm facing is this:

My MySQL database contains customer numbers, which I don't want to display in my report, but instead I want to display
customer names. Problem is, the names are in an MDB-file (which I have access to by using DSN and JDBC-ODBC), so
how do I access them and fetch the names instead of the number? Both databases contain the customer number for
reference.Is there any way I could use the template report from iReport in Java and do some logic to replace the numbers
with the names?

Edit: I figured out how to resolve my problem. In case anyone is interested, here's how I did it:
Instead of letting JasperReports handle the database connection and all that, I made a new class which implements the
JRDataSource methods for filling a report. Then I just filled the Object[][] with data from my database class. Basically, I
only used iReport to design the report and generate a .jasper-file. Here's how to implement it!