krillian konstatos

Ranch Hand
+ Follow
since Jan 03, 2011
krillian likes ...
Netbeans IDE PHP Java
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by krillian konstatos

This is now solved and closed by me the cause was due to "human-error"

8 years ago
Hi, all!

I am working on a project where i need to show a year value in a class that extends JSpinner.
Its working just fine but when i try to set an alignment value for the editor textfield it all falls
apart and i know im missing something really critical here but i can't see or find it all i know
is that i can't make a proper reference to the textfield component in the editor i use in the
correct way or aproach.

Sorry for my english grammar its not my main language. But here i am listing the code that
i work with. If anyone could point me in the correct way to the right approch at doing the
following then i would be very much gratetful in deed. What am i missing? I have been
trying to solve this for several days now and i am stuck.

Best regards,
Krillian K!
8 years ago

Randall Twede wrote:one way to look at it is "if it works it is correct"
as far as style, i am no expert, and i only skimmed through your code, but it looks pretty good in general

Thank you so much for your reply and it works fine for the project in question and thank you so much for your
compliment on the style. It sheared me up a little after a lot of struggling with java's graphic handling
packages and thumbnail image processing.

10 years ago
hi, all!

I am just wondering if it is possible to retrive by that i refer to read exif data that are part of
an image objects header file like camera type and color model and so on ? Im very much
into javas picture handling features theese days and i have wondered about this for a long
time but i haven't done that much researching about this topic yet but i know that there is
a library for this out there called sanselan if i remembered it correctly? If there is a way to
retrieve exif data using the imageio package i'd be very much greatful for any tips or hints
on how to accieve this. I dont know that much about exif otherwise but i am learning more
and more.

best regards,
10 years ago
hi, forumsts!

I have had big problem width image handling in java. I am having a project where i must create
thumbnail images in JButton objects and when the user click on theese buttons a maximized
undecorated frame is opened and displays a larger variant of the selected image / images.
I have rendered the thumbnail images to icons for the button objects using the getScaledInstance
method in the Image class. But i am still unsure of if i have the grip on this operation or not.
I first assign a thumbnail image to a label in large frame and in an filterIcon method i convert
the image from that icon label to an object using the BufferedImage class and create a larger
icon image for my label object. I must also consider the size of the selected image to that part
that i dont want to display images that are smaller than the width of 800 pixels to be displayed
all over the screen but half of that size. Images that are larger than 800 will be displayed over
the screen with their defalt sizes. I have the code below ...

I just need some hints or tips how to do this correct i am a rookie and i know i must have missed out a lot.
I have read some articles on the subjects in question but i am still unsure. I hope i have been clear enough
in my description of the problem in this post.

Best regards,
10 years ago
Hi, forumists!

I have a problem regarding the creation of thumbnails from images selected from a filechooser.
I draw theese thumbnails on a JLabel object with the width and height set to 133 x 98. I am not
that sure if i am using the standard approach to do this i have the code as posted below.

I am creating the icon on a variable referred to a BufferedImage and attach this to
my JLabel object. It is now that i am uncertain of if i am doing things in the right order. I want to
paint the icon in question on my JLabel object using the graphics and dimension that are
derrived from the BufferedImage object? Is this the correct way or is there something that
i have missed out totally or should i do things much differently? All feedback is greatly
appreciated since i am struggling very hard with an image organizer application.

Very kind regards,
11 years ago
this case is solved for now, anyway i have manage to get it to work as i have imagined at first i have modified the
method below this line in the following way ...

If someone have second thoughts to my solution or other opinions to it please feel free to
write them down here. Thanks a lot to all who have visited this post.

11 years ago
Good evening, all!

I have encountered a tricky problem for me in a project where i wan't to populate a JTree component object
with nodes which are constructed from a multidimensional array of tree data objects. Theese nodes are
inserted into my treemodel with the insertNodeInto(DefaultMutableTreeNode node, DefaultMutableTreeNode parent,
int index) method in the DefaultTreeModel class.

Below i have posted the following example of my TreeData class that i want to use in my tree nodes as a user object

The TreeData class in the above piece of code controls the layout in a JPanel object in my project's main class.
Anyway its not important for this post what this object does. As I said earlier I want to populate a JTree from TreeData objects
that reside within a multidiemensional array. The TreeData object that takes only one String object as a parameter in it's constructor
is user objects attached to the parent nodes in my JTree.

Below i have a piece of code that demonstrated how i wish to accomplish this attempt i could use another approach i am thinking of
doing this using xml parsing instead but for now i need some hint on how to populate the jtree object correctly so that the nodes will be
inserted into model in the correct order so far my node insertion attempts have only resulted in reversed order i am not good at
using the collection classes in java but i know the solution to this problem is there somewhere ...

Below theese lines are an example of what i have tried so far to populate my JTree object from a multi diemensional.
The code below only results in the fact that the nodes in my JTree appears in a reversed order.

How can i use the Set<Object> class or the ListIterator<Object> class
to iterate through my arrays of TreeData and insert them into a treemodel in the correct order and in a way similar to the one in the code example above this line?
I have only used collection classes with a single array of objects as a generic parameter. I hope i have been clear enough in the description of my problem in
question. I would really appreciate any kind of hint or help here and thanks a lot for your visit here.

im a collection "camper".
11 years ago

I have fixed my problem with the "table alredy exists" exception as shown in the
code snippet below theese lines ...

It would be great if i got some feedback on my approach to validate the table names in the database.
I hope someone can see what i am concerned with and tell me if i am close to a general solution to
my problem in question or not.

When it comes to working with derby at command prompt level and in the ant and maven environments
i have much left to learn. Thanks a lot in advance anyway!

Thanks a lot in advance.
hello, everyone!

I have a question about how yuo export tables that you create using the ij tool in the derby tool.
I know that there are many many texts about this out there but i haven't learned the ij tool that
well yet so far i have created my derby tables directly in the java source code but i have realized
that it is not that recommended to do maybe i am totally wrong about this but there is that
message "Table/View 'MY_TABLE' already exists in Schema x" that comes out so often when i
am creating tables in the java source code and i have managed to avoid this using a method
that takes care of a "drop table if exists" action properly yet. I know that there are an error code
that represent the table already exists exception in derby but my time is limited and i have
read in some posts on the web that the best way to use tables in a application that uses the
embedded derby driver is to use the ij tool to put them in jar files and then add them to the
classpath or have i missunderstood something completely here? my questions is as shown below

1. How do i export and tables from the ij tool in jar files so that i can put theese to my classpath
so my applications can access them directly after startup without creating them in some class or
method? If someone could explain this in a list-based step my appreciation would then go
beyond limits.

2. How can i avoid SQLState-errors properly using for example a boolean method?

I hope i haven't been totally wrong about the issues in question. I am struggling very hard to
learn jdbc and tools like ant and maven.

Very kind regards,
hi, everyone!

I am using GridBagLayout a lot as my favorite layoutmanager and often i have had the need to set
equal margin values for JButton objects in other words i want the space from the left and the right
edges of the text to be of the same width. I know it might be easier to use other layoutmanagers
but for now i am confused with this issue. I have an example of code to highlight my problem in the
space below this text:

In the code snippet above its obvious that the "view titles" button object will always be larger than
the button object labeled "Save". How can i set the margin with for the save button in the code
above so that this button will stretch out to the same width as the "view titles" button? I have not
experimented that much with the FontMetrics class but i can imagine that its there that the solution
to my problem resides or maybe i am completely missing something big here and should stick to
another layoutmanager for this purpose ... i just need some advice on how to see things clearer
around this problem.

11 years ago
I have a project in which i uses three instances of a JTabbedPane component. The first is presented as "menu" attached to the main jframe.
Here i have two tabs. Now the second tabs contains a class that extends a JPanel object in which i use a JSplitPane as main component.
As lower component in the splitpane object i use a JDesktopPane component containing a JInternalFrame presenting a form. The second JTabbedPane
object is located in the main JTabbedPane component and here i use another JDesktopPane component with a second JInternalFrame attached to it
containing a user selection form. In this the second JTabbedPane component i use five different tabs containing JPanel objects so the whole application
uses totally a number of seven tabs. My question is if it is wise to use nested jtabbedpane components even if they are divided and located in
subcomponents? I have heard that the use of tabbedpane takes up a lot of cpu memory not just in java but also in other environments. Is this a
correct observation from my point? Maybe i have totally wrong and should not worry about this issue at all. I hope somone will understand what i am concerned with
for the future development of my project in question maybe i should limit my use of tabbedpane components to one instance.
Finally i am not that comfortable in describing subjects like this in english in case someone will notice it
11 years ago
thanks to all for the replies on this post. i think i have taken too much water over my head for this problem. I think the solution has more to do with components than date programming. it's just that i have a complex form with a lot of labels spinners, textfields and so on and i want to present default values such as "none applicable" at the start in every component. i think i rather use a checkbox next to the component in question with the label "N/A" when it comes to spinner components and in a combobox i can just have an empty selection value at the top of the list.
11 years ago

I have a problem with a date issue. I want to format a value from a SimpleDateFormat
object into a date without a timestamp or a GMT field. The date in question is a custom
one and not a date object from an instance of a Calendar like

I am using the set method in the Calendar class to initialize a date starting from
the first of january, 1900. I have used the clear method in the forementioned class
to clear the timestamp in the calendar object but it doent works at all or maybe i am
totally missing something out here.

I hope someone can point me to a correct solution to my problem in question. I am a beginner so i have to
pardon my poor attempts in this post.


11 years ago

Campbell Ritchie wrote:Go and search for Apache Commons and Joda Time (or maybe Yoda Time??). You may find time and date classes there which are easier to use than the standard Java™ API.


I have thought about something like this before but then again i want to avoid using external libraries i dont know that mush
about licensing issues and so on but thanks a lot for the tip!
11 years ago